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.

A056458 Number of primitive (aperiodic) palindromes using a maximum of two different symbols.

Original entry on oeis.org

2, 0, 2, 2, 6, 4, 14, 12, 28, 24, 62, 54, 126, 112, 246, 240, 510, 476, 1022, 990, 2030, 1984, 4094, 4020, 8184, 8064, 16352, 16254, 32766, 32484, 65534, 65280, 131006, 130560, 262122, 261576, 524286, 523264, 1048446, 1047540, 2097150, 2094988, 4194302, 4192254
Offset: 1

Views

Author

Keywords

Crossrefs

Column 2 of A284823.

Programs

  • Maple
    f:= proc(n) local d; add(numtheory:-mobius(d)*2^floor((1+n/d)/2), d = numtheory:-divisors(n)) end proc:
    map(f, [$1..50]); # Robert Israel, Feb 18 2025
  • PARI
    a(n) = sumdiv(n, d, moebius(d)*2^((1 + n/d)\2)); \\ Michel Marcus, Apr 24 2020
    
  • Python
    from sympy import mobius, divisors
    def A056458(n): return sum(mobius(n//d)<<(1+d>>1) for d in divisors(n, generator=True)) # Chai Wah Wu, Feb 18 2024

Formula

a(n) = Sum_{d|n} mu(d)*A016116(1 + n/d).
a(n) = 2 * A056476(n). - Alois P. Heinz, Feb 18 2025

Extensions

More terms from Michel Marcus, Apr 24 2020