Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9165295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:52:36+00:00 2026-06-17T14:52:36+00:00

I Have 3 Arrays Array 1 : Array ( [0] => 0 [1] =>

  • 0

I Have 3 Arrays

Array 1 :

 Array ( [0] => 0 [1] => 256 [2] => 512 [3] => 768 [4] => 1024 [5] => 1280 [6] => 1536 [7] => 1792 [8] => 2048 [9] => 2304 [10] => 2560 [11] => 2816 [12] => 3072 [13] => 3328 [14] => 3584 [15] => 3840 [16] => 4096 [17] => 4352 [18] => 4608 [19] => 4864 [20] => 5120 [21] => 5376 [22] => 5632 [23] => 5888 )

Array 2 :

Array ( [0] => 0 [1] => 65536 [2] => 131072 [3] => 196608 [4] => 262144 [5] => 327680 [6] => 393216 [7] => 458752 [8] => 524288 [9] => 589824 [10] => 655360 [11] => 720896 [12] => 786432 [13] => 851968 [14] => 917504 [15] => 983040 [16] => 1048576 [17] => 1114112 [18] => 1179648 [19] => 1245184 [20] => 1310720 [21] => 1376256 [22] => 1441792 [23] => 1507328 [24] => 1572864 [25] => 1638400 [26] => 1703936 [27] => 1769472 [28] => 1835008 [29] => 1900544 [30] => 1966080 [31] => 2031616 )

Array 3 :

Array ( [0] => 0 [1] => 1 [2] => 2 [3] => 3 [4] => 4 [5] => 5 [6] => 6 [7] => 7 [8] => 8 [9] => 9 [10] => 10 [11] => 11 [12] => 12 [13] => 13 [14] => 14 [15] => 15 [16] => 16 [17] => 17 [18] => 18 [19] => 19 [20] => 20 [21] => 21 [22] => 22 [23] => 23 [24] => 24 [25] => 25 [26] => 26 [27] => 27 [28] => 28 [29] => 29 [30] => 30 [31] => 31 )

Given a number X which I know was calculated as a1[i] + a2[j] + a3[k] how can I calculate i, j and k?

Examples:

  1. X = 458752 => i=0, j=7, k=0 which is 458752 = 0 + 458752 + 0
  2. X = 131586 => i=2, j=2, k=2 which is 131586 = 256 + 131072 + 2
  3. X = 65793 => i=1, j=1, k=1 which is 65793 = 256 + 65536 + 1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T14:52:37+00:00Added an answer on June 17, 2026 at 2:52 pm

    How about:

    foreach(array(458752, 131586, 65793) as $x) {
        $j = intval($x / 65536);
        $x = $x % 65536;
        $i = intval($x / 256);
        $k = $x % 256;
        echo "x=$x, i=$i, j=$j, k=$k\n";
    }
    

    output:

    x=0, i=0, j=7, k=0
    x=514, i=2, j=2, k=2
    x=257, i=1, j=1, k=1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array of arrays: Array ( [0] => Array ( [id] =
I have two arrays: $array1 = array(1=>1,10=>1,12=>0,13=>13); $array2 = array(1=>Hello,10=>Test,12=>check,13=>error); Here $array1 has keys
Consider I have two arrays: $friends = Array('foo', 'bar', 'alpha'); $attendees = Array('foo', 'bar');
I have arrays like this. [11] => Array ( [transactioncurrencyid] => Array ( [!name]
Say we have array of arrays: tree_limbs = Array.new tree_limbs << %w(1 2 3
i have two arrays like this first array Array ( [0228] => Array (
I have 3 arrays like this: 1st Array ( [0695] => Array ( [loan_number]
I have two arrays... $Name = array(a, b, c, d); $Value = array(1, 2,
I have two arrays the first one has this structure Parameter Keys array array
I have created an array thusly: import numpy as np data = np.zeros( (512,512,3),

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.