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-2 of 2 results.

A254608 a(n) is the smallest number such that A254606(a(n)) = n.

Original entry on oeis.org

1, 2, 9, 14, 27, 26, 34, 63, 64, 53, 89, 115, 88, 165, 101, 116, 132, 292, 149, 185, 166, 225, 271, 205, 270, 318, 247, 397, 294, 293, 319, 370, 371, 344, 399, 398, 427, 691, 489, 488, 553, 552, 520, 655, 658, 620, 622, 769, 621, 693, 656, 731, 851, 810, 732
Offset: 0

Views

Author

Lei Zhou, Feb 02 2015

Keywords

Examples

			A254606(1)=0, so a(0)=1;
A254606(2)=1, so a(1)=2;
A254606(m)<2 for all m<9, and A254606(9)=2, so a(2)=9.
		

Crossrefs

Cf. A254606.

Programs

  • Mathematica
    NumDiff[n1_, n2_] :=  Module[{c1 = n1, c2 = n2}, If[c1 < c2, c1 = c1 + c2; c2 = c1 - c2; c1 = c1 - c2];
      k = Floor[c1/c2]; a1 = c1 - k*c2; If[a1 == 0, a2 = 0, a2 = (k + 1) c2 - c1]; Return[Min[a1, a2]]];
    a = {1}; n = 0; p1 = 2; p2 = 1; lb = 0; While[lb < 100, n++; p2 = NextPrime[p2]; If[p2 > p1, p1 = p2; p2 = 2];
    d = NumDiff[p1, p2]; While[l = Length[a]; l <= d, AppendTo[a, 0]]; If[a[[d + 1]] == 0, a[[d + 1]] = n; ps = Position[a, 0]; If[Length[ps] == 0, b = a, ps1 = ps[[1]][[1]]; b = Take[a, ps1 - 1]]; lb = Length[b]]]; b

A254610 Number of decompositions of 2n into sums of two primes p1 <= p2 such that the smallest |k*p1-p2| = 2^m+b, where |b|<=2.

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 2, 4, 4, 2, 3, 4, 3, 4, 5, 4, 3, 5, 3, 4, 6, 3, 5, 6, 2, 4, 6, 4, 4, 7, 4, 5, 8, 5, 4, 9, 4, 4, 7, 2, 5, 7, 4, 5, 8, 5, 6, 9, 5, 5, 11, 4, 5, 8, 3, 5, 7, 5, 4, 7, 6, 6, 8, 5, 4, 9, 3, 6, 8, 4, 7, 9, 4, 5, 11, 7, 5, 8
Offset: 1

Views

Author

Lei Zhou, Feb 02 2015

Keywords

Comments

a(1)=0 is the only zero term up to n=200000.
It is hypothesized that a(1)=0 is the only zero term of this sequence.
The histogram for 1<=n<=60000 of this sequence shows the shape of a distribution with mode=10, and it has a regional maximum at 20.

Examples

			For n=1, 2n=2, which cannot be decomposed into the sum of two primes, so a(1)=0.
For n=2, 2n = 4 = 2+2, and 2-2 = 0 = 2^0-1, so the difference from 2^0 is 1, which satisfies the condition. So a(2)=1;
...
For n=5, 2n = 10 = 3+7 = 5+5. |3*2-7| = 1 = 2^0 and |5-5| = 0 = 2^0-1; both satisfy the condition, so a(5)=2.
...
For n=35, 2n = 70 = 3+67 = 11+59 = 17+53 = 23+47 = 29+41. These five Goldbach decompositions make A045917(35)=5. Among these, |3*22-67| = 1 = 2^0; |11*5-59| = 4 = 2^2; |17*3-53| = 2 = 2^1; |23*2-47| = 1 satisfies the condition. However, |29-41| = 12 = 2^3+4 = 2^4-4 does not satisfy the condition. So, a(35)=4 < A045917(35). This is the first term where the two sequences differ.
		

Crossrefs

Programs

  • Mathematica
    NumDiff[n1_, n2_] :=  Module[{c1 = n1, c2 = n2}, If[c1 < c2, c1 = c1 + c2; c2 = c1 - c2; c1 = c1 - c2]; k = Floor[c1/c2]; a1 = c1 - k*c2; If[a1 == 0, a2 = 0, a2 = (k + 1) c2 - c1]; Return[Min[a1, a2]]];
    Table[e = 2 n; p1 = 1; ct = 0; While[p1 = NextPrime[p1]; p1 <= n, p2 = e - p1; If[PrimeQ[p2], d = NumDiff[p1, p2]; k = Floor[Log[2, d]]; diff1 = d - 2^k; If[diff1 == 0, ct++, diff2 = 2^(k + 1) - d; If[(diff1 <= 2) || (diff2 <= 2), ct++]]]]; ct, {n, 1, 100}]
Showing 1-2 of 2 results.