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.

A385126 Hereditarily evil prime powers: numbers of the form p^k where p is prime and p^j is evil for 1 <= j <= k.

Original entry on oeis.org

3, 5, 9, 17, 23, 27, 29, 43, 53, 71, 83, 89, 101, 113, 139, 149, 163, 197, 257, 263, 269, 277, 281, 293, 311, 317, 337, 347, 349, 353, 359, 373, 383, 389, 401, 449, 461, 467, 479, 503, 509, 523, 547, 571, 593, 599, 619, 643, 673, 683, 691, 739, 751, 773, 797, 811, 821, 839, 853, 857, 863, 881
Offset: 1

Views

Author

Robert Israel, Jun 18 2025

Keywords

Examples

			a(6) = 27 is a term because 3, 9 and 27 are all evil.
The first term that is a fourth power is 277^4 = 5887339441.
The first term that is a fifth power is 317^5 = 3201078401357.
		

Crossrefs

Cf. A001969.
Contains A027699.

Programs

  • Maple
    isevil:= proc(n) convert(convert(n,base,2),`+`)::even end proc:
    M:= 1000: # for terms <= M
    R:= NULL:
    p:= 1:
    do
      p:= nextprime(p);
      if p > M then break fi;
      for k from 1 do
        z:= p^k;
        if z > M then break fi;
        if isevil(z) then R:= R, z
        else break
        fi
      od
    od:
    sort([R]);