cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-4 of 4 results.

A059873 The lexicographically earliest sequence of binary encodings of solutions satisfying the equation given in A059871.

Original entry on oeis.org

1, 3, 5, 13, 21, 46, 78, 175, 303, 639, 1143, 2539, 4542, 9214, 17406, 36735, 69374, 139254, 270327, 556031, 1079294, 2162678, 4259819, 8642558, 17022974, 34078590, 67632893, 136249338, 270401534, 541064701, 1077935867, 2162163707
Offset: 1

Views

Author

Antti Karttunen, Feb 05 2001

Keywords

Comments

The encoding is explained in A059872. Apply bin_prime_sum (see A059876) to this sequence and you get A000040, the prime numbers.

Crossrefs

Programs

  • Maple
    primesums_primes_search(16); primesums_primes_search := (upto_n) -> primesums_primes_search_aux([],1,upto_n); primesums_primes_search_aux := proc(a,n,upto_n) local i,p,t; if(n > upto_n) then RETURN(a); fi; p := ithprime(n); for i from (2^(n-1)) to ((2^n)-1) do t := bin_prime_sum(i); if(t = p) then print([op(a),i]); RETURN(primesums_primes_search_aux([op(a),i],n+1,upto_n)); fi; od; RETURN([op(a),`and no more found`]); end;

Extensions

More terms from Naohiro Nomoto, Sep 12 2001
More terms from Larry Reeves (larryr(AT)acm.org), Nov 20 2003

A059875 The lexicographically last sequence of binary encodings of solutions satisfying the equation given in A059871.

Original entry on oeis.org

1, 3, 5, 13, 21, 52, 84, 210, 392, 905, 1601, 3652, 7173, 15364, 28932, 61952, 122900, 253969, 493572, 1017858, 2031636, 4128801, 8159232, 16547841, 33030657, 66584836, 132251649, 266600448, 532677128, 1069548544, 2139095042
Offset: 1

Views

Author

Antti Karttunen, Feb 05 2001

Keywords

Comments

Apply bin_prime_sum (see A059876) to this sequence and you get A000040, the prime numbers.

Crossrefs

Programs

  • Maple
    map(last_term, primesums_primes_mult(16)); last_term := proc(l) local n: n := nops(l); if(0 = n) then ([]) else (op(n,l)): fi: end: # primesums_primes_mult given in A059871.

Extensions

More terms from Naohiro Nomoto, Sep 12 2001
More terms from Larry Reeves (larryr(AT)acm.org), Nov 20 2003

A059872 Solutions to the equation given in A059871, encoded as binary vectors and converted to decimal.

Original entry on oeis.org

1, 3, 5, 13, 21, 46, 51, 52, 78, 83, 84, 175, 181, 205, 210, 303, 309, 333, 338, 390, 392, 639, 698, 726, 728, 737, 822, 824, 846, 851, 852, 903, 905, 1143, 1145, 1197, 1202, 1226, 1232, 1311, 1322, 1328, 1350, 1352, 1409, 1562, 1571, 1572, 1601, 2539, 2540
Offset: 1

Views

Author

Antti Karttunen, Feb 05 2001

Keywords

Comments

The rows of this table have lengths given by A059871.
In binary encodings, the least significant bit (bit-0) stands for the factor of 1, the next bit (bit-1) stands for the factor of 2, bit-2 for the factor of 3, bit-3 for the factor of 5, etc., each bit being 0 if the corresponding factor is -1 and 1 if it is +1 (or +2 if the bit is the most significant bit of the code of odd length).
E.g. we have 2 = 2*1 -> 1 in binary, 3 = 1*2 + 1*1 -> 11 in binary, 5 = 2*3 - 1*2 + 1*1 -> 101 in binary, 7 = 1*5 + 1*3 - 1*2 + 1*1 -> 1101 in binary, 11 = 2*7 - 1*5 + 1*3 - 1*2 + 1*1 -> 10101 in binary. Function bin_prime_sum given in A059876 maps such encodings back to primes.

Examples

			Rows are:
  1;
  3;
  5;
  13;
  21;
  46,51,52;
  78,83,84;
  175,181,205,210;
  ...
		

Crossrefs

Programs

  • Maple
    map(op, primesums_primes_mult(16)); # primesums_primes_mult given in A059871.

A059876 a(n) = bin_prime_sum(n).

Original entry on oeis.org

2, 1, 3, 3, 5, 7, 9, -1, 1, 3, 5, 5, 7, 9, 11, 3, 5, 7, 9, 9, 11, 13, 15, 13, 15, 17, 19, 19, 21, 23, 25, -7, -5, -3, -1, -1, 1, 3, 5, 3, 5, 7, 9, 9, 11, 13, 15, 7, 9, 11, 13, 13, 15, 17, 19, 17, 19, 21, 23, 23, 25, 27, 29, -3, -1, 1, 3, 3, 5, 7, 9, 7, 9, 11, 13, 13, 15, 17, 19, 11, 13, 15, 17, 17, 19, 21, 23, 21, 23, 25, 27, 27, 29, 31, 33, 19, 21, 23, 25, 25, 27, 29, 31, 29, 31
Offset: 1

Views

Author

Antti Karttunen, Feb 05 2001

Keywords

Comments

From R. J. Mathar, Nov 12 2011: (Start)
The function bin_prime_sum of an argument n is a sum of three numbers. Let s = A000523(n) be the exponent of the largest power of 2 less than or equal to n and prime=A000040. Then the three terms are:
i) (-1)^(n+1);
ii) sum_{i=1..s} prime(i) * (1 + (-1)^[n/2^i] ); where [..] is the floor bracket;
iii) 1 (if n=1), otherwise prime(s) (if s even) or 0 (if s odd). (End)

Crossrefs

Programs

  • Maple
    with(numtheory); bin_prime_sum := proc(n) local i,s; s := floor_log_2(n); RETURN(((-1)^(n+1)) + add( (((-1)^(floor(n/(2^i))+1))*ithprime(i)),i=1..s) + (`if`((1 = n),1,((`mod`((s+1),2))*ithprime(s)))) ); end;
  • Mathematica
    a[n_] := With[{s = Floor[Log[2, n]]}, (-1)^(n+1) + Sum[(-1)^(Floor[n/2^i] + 1)*Prime[i], {i, 1, s}] + If[1 == n, 1, Mod[s+1, 2]*Prime[s]]]; Array[a, 105] (* Jean-François Alcover, Mar 07 2016, adapted from Maple *)

Formula

a(A059873(n)) = A000040(n).
Showing 1-4 of 4 results.