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

A095731 Number of such primes p (A095730) such that Fib(n+1) <= p < Fib(n+2) (where Fib = A000045) and p's Zeckendorf-expansion A014417(p) is palindromic.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 2, 2, 0, 3, 3, 0, 4, 8, 0, 15, 4, 0, 20, 42, 0, 44, 35, 0, 67, 147, 0, 231, 147, 0, 209, 538, 0, 833, 450, 0, 819, 2064, 0, 1701
Offset: 1

Views

Author

Antti Karttunen, Jun 12 2004

Keywords

Crossrefs

A016041 Primes that are palindromic in base 2 (but written here in base 10).

Original entry on oeis.org

3, 5, 7, 17, 31, 73, 107, 127, 257, 313, 443, 1193, 1453, 1571, 1619, 1787, 1831, 1879, 4889, 5113, 5189, 5557, 5869, 5981, 6211, 6827, 7607, 7759, 7919, 8191, 17377, 18097, 18289, 19433, 19609, 19801, 21157, 22541, 22669, 22861, 23581, 24029
Offset: 1

Views

Author

Keywords

Comments

See A002385 for palindromic primes in base 10, and A256081 for primes whose binary expansion is "balanced" (see there) but not palindromic. - M. F. Hasler, Mar 14 2015
Number of terms less than 4^k, k=1,2,3,...: 1, 3, 5, 8, 11, 18, 30, 53, 93, 187, 329, 600, 1080, 1936, 3657, 6756, 12328, 23127, 43909, 83377, 156049, 295916, 570396, 1090772, 2077090, 3991187, 7717804, 14825247, 28507572, 54938369, 106350934, ..., partial sums of A095741 plus 1. - Robert G. Wilson v, Feb 23 2018, corrected by Jeppe Stig Nielsen, Jun 17 2023

Crossrefs

Intersection of A000040 and A006995.
First row of A095749.
A095741 gives the number of terms in range [2^(2n), 2^(2n+1)].
Cf. A095730 (primes whose Zeckendorf expansion is palindromic), A029971 (primes whose ternary (base-3) expansion is palindromic).
Cf. A117697 (written in base 2), A002385, A194097, A256081.

Programs

  • Magma
    [NthPrime(n): n in [1..5000] | (Intseq(NthPrime(n), 2) eq Reverse(Intseq(NthPrime(n), 2)))]; // Vincenzo Librandi, Feb 24 2018
    
  • Mathematica
    lst = {}; Do[ If[ PrimeQ@n, t = IntegerDigits[n, 2]; If[ FromDigits@t == FromDigits@ Reverse@ t, AppendTo[lst, n]]], {n, 3, 50000, 2}]; lst (* syntax corrected by Robert G. Wilson v, Aug 10 2009 *)
    pal2Q[n_] := Reverse[x = IntegerDigits[n, 2]] == x; Select[Prime[Range[2800]], pal2Q[#] &] (* Jayanta Basu, Jun 23 2013 *)
    genPal[n_Integer, base_Integer: 10] := Block[{id = IntegerDigits[n, base], insert = Join[{{}}, {# - 1} & /@ Range[base]]}, FromDigits[#, base] & /@ (Join[id, #, Reverse@id] & /@ insert)]; k = 0; lst = {}; While[k < 100, AppendTo[lst, Select[ genPal[k, 2], PrimeQ]]; lst = Flatten@ lst; k++]; lst (* Robert G. Wilson v, Feb 23 2018 *)
  • PARI
    is(n)=isprime(n)&&Vecrev(n=binary(n))==n \\ M. F. Hasler, Feb 23 2018
    
  • Python
    from sympy import isprime
    def ok(n): return isprime(n) and (b:=bin(n)[2:]) == b[::-1]
    print([k for k in range(10**5) if ok(k)]) # Michael S. Branicky, Apr 20 2024

Formula

Sum_{n>=1} 1/a(n) = A194097. - Amiram Eldar, Mar 19 2021

Extensions

More terms from Patrick De Geest

A094202 Integers k whose Zeckendorf representation A014417(k) is palindromic.

Original entry on oeis.org

0, 1, 4, 6, 9, 12, 14, 22, 27, 33, 35, 51, 56, 64, 74, 80, 88, 90, 116, 127, 145, 158, 174, 184, 197, 203, 216, 232, 234, 276, 294, 326, 368, 378, 399, 425, 441, 462, 472, 493, 519, 525, 546, 572, 588, 609, 611, 679, 708, 760, 828, 847, 915, 944, 988, 1022, 1064, 1090
Offset: 1

Views

Author

Ron Knott, May 25 2004

Keywords

Examples

			Fibonacci base columns are ...,8,5,3,2,1 with column entries 0 or 1 and no two consecutive ones (the Zeckendorf representation) so that each n has a unique representation.
12 is in the sequence because 12 = 8 + 3 + 1 = 10101 base Fib; 14 = 13 + 1 = 100001 base Fib.
		

References

  • C. G. Lekkerkerker, Voorstelling van natuurlijke getallen door een som van getallen van Fibonacci, Simon Stevin vol. 29, 1952, pages 190-195.
  • E. Zeckendorf, Représentation des nombres naturels par une somme de nombres de Fibonacci ou de nombres de Lucas, Bulletin de la Société Royale des Sciences de Liège vol. 41 (1972) pages 179-182.

Crossrefs

Gives the positions of zeros in A095734. Subsets: A095730, A048757. A006995 gives the integers whose binary expansion is palindromic.

Programs

  • Mathematica
    zeck[n_Integer] := Block[{k = Ceiling[ Log[ GoldenRatio, n*Sqrt[5]]], t = n, fr = {}}, While[k > 1, If[t >= Fibonacci[k], AppendTo[ fr, 1]; t = t - Fibonacci[k], AppendTo[fr, 0]]; k-- ]; FromDigits[fr]]; a = {}; Do[z = zeck[n]; If[ FromDigits[ Reverse[ IntegerDigits[z]]] == z, AppendTo[a, n]], {n, 1123}]; a (* Robert G. Wilson v, May 29 2004 *)
    mirror[dig_, s_] := Join[dig, s, Reverse[dig]]; select[v_, mid_] := Select[v, Length[#] == 0 || Last[#] != mid &]; fib[dig_] := Plus @@ (dig * Fibonacci[Range[2, Length[dig] + 1]]); pals = Rest[IntegerDigits /@ FromDigits /@ Select[Tuples[{0, 1}, 7], SequenceCount[#, {1, 1}] == 0 &]]; Union@Join[{0, 1}, fib /@ Join[mirror[#, {}] & /@ (select[pals, 1]), mirror[#, {1}] & /@ (select[pals, 1]), mirror[#, {0}] & /@ pals]] (* Amiram Eldar, Jan 11 2020 *)
  • Python
    from sympy import fibonacci
    def a(n):
        k=0
        x=0
        while n>0:
            k=0
            while fibonacci(k)<=n: k+=1
            x+=10**(k - 3)
            n-=fibonacci(k - 1)
        return x
    def ok(n):
        x=str(a(n))
        return x==x[::-1]
    print([n for n in range(1101) if ok(n)]) # Indranil Ghosh, Jun 07 2017

Extensions

More terms from Robert G. Wilson v, May 28 2004
Offset changed to 1 by Alois P. Heinz, Aug 02 2017

A095732 Sum of A095734(p) for all primes p such that Fib(n+1) <= p < Fib(n+2) (where Fib = A000045).

Original entry on oeis.org

0, 0, 1, 3, 1, 3, 7, 10, 12, 23, 31, 58, 93, 171, 243, 422, 634, 1142, 1684, 2971, 4406, 7768, 11502, 20502, 30242, 53039, 79161, 138410, 207536, 362391, 544895, 947189, 1431794, 2473232, 3749944, 6459373, 9823917, 16879245, 25745781, 44112347
Offset: 1

Views

Author

Antti Karttunen, Jun 12 2004

Keywords

Comments

Ratio a(n)/A095354(n) converges as follows: 1, 1, 1, 1.5, 1, 1, 2.333333, 2, 1.714286, 2.090909, 1.9375, 2.416667, 2.513514, 3.109091, 2.892857, 3.349206, 3.20202, 3.845118, 3.676856, 4.22017, 4.053358, 4.640382, 4.420446, 5.088608, 4.828676, 5.446601, 5.212762, 5.838853, 5.611963, 6.257939, 6.017615, 6.668795, 6.424778, 7.069164, 6.819283, 7.467319, 7.215081, 7.868411, 7.614126, 8.269242

Examples

			a(1) = a(2) = 0, as there are no primes in ranges [1,2[ and [2,3[. a(3)=1 as in [3,5[ there is prime 3 with Fibonacci-representation 100, which is just a one fibit-flip away from being a palindrome (i.e. A095734(3)=1). a(4)=3, as in [5,8[ there are primes 5 and 7, whose Fibonacci-representations are 1000 and 1010 respectively and the other needs one bit-flip and the other two to become palindromes and 1 + 2 = 3. a(5)=1, as in [8,13[ there is only one prime 11, with Zeckendorf-representation 10100, which needs to have just its least significant fibit flipped from 0 to 1 to become palindrome.
		

Crossrefs

Cf. A095730, A095731, A095742 (sums of similar assymetricity measures for binary-expansion).

A095733 Zeckendorf-expansion A014417(p) of primes p for which this expansion is palindromic.

Original entry on oeis.org

1010000101, 10010101001, 1000101001010001, 1001010000101001, 10010001010001001, 10100100000100101, 1000001001001000001, 1000100101010010001, 1010010100010100101, 10001010000001010001
Offset: 1

Views

Author

Antti Karttunen, Jun 05 2004

Keywords

Examples

			The first such prime is 127 = F(2)+F(4)+F(9)+F(11) (which thus has a symmetric Zeckendorf-expansion as 1010000101).
		

Crossrefs

a(n) = A014417(A095730(n)).
Showing 1-5 of 5 results.