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.

A096269 a(n) = number of distinct palindromes of length n that occur in A096268.

Original entry on oeis.org

2, 1, 3, 0, 4, 0, 3, 0, 4, 0, 4, 0, 3, 0, 3, 0, 4, 0, 4, 0, 4, 0, 4, 0, 3, 0, 3, 0, 3, 0, 3, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3
Offset: 1

Views

Author

N. J. A. Sloane, Jun 22 2004

Keywords

Crossrefs

Cf. A096268.

Programs

  • PARI
    A096269(n) = if(n<=2,3-n,if(3==n,n,if(!(n%2),0,my(pp2=2^(#binary(n)-1)); if(((2*pp2)-n)<(n-pp2),3,4)))); \\ Antti Karttunen, Mar 30 2021

Formula

For even n >= 4, a(n) = 0; for odd n >= 5, a(n) = a(2n-1) = a(2n+1).
For odd n >= 5, let x be the power of 2 closest to n; if n > x then a(n) = 4 and if n < x then a(n) = 3. - David Wasserman, Nov 01 2007

Extensions

More terms from David Wasserman, Nov 01 2007