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.

A033548 Honaker primes: primes P(k) such that sum of digits of P(k) equals sum of digits of k.

Original entry on oeis.org

131, 263, 457, 1039, 1049, 1091, 1301, 1361, 1433, 1571, 1913, 1933, 2141, 2221, 2273, 2441, 2591, 2663, 2707, 2719, 2729, 2803, 3067, 3137, 3229, 3433, 3559, 3631, 4091, 4153, 4357, 4397, 4703, 4723, 4903, 5009, 5507, 5701, 5711, 5741, 5801, 5843
Offset: 1

Views

Author

Calculated by Jud McCranie

Keywords

Comments

A090431(A049084(a(n))) = 0.

Examples

			131 is the 32nd prime and sum of digits of both is 5.
		

References

Crossrefs

Programs

  • Haskell
    a033548 n = a033548_list !! (n-1)
    a033548_list = filter ((== 0) . a090431 . a049084) a000040_list
    -- Reinhard Zumkeller, Mar 16 2014
    
  • Maple
    read("transforms") :
    isA033548 := proc(n)
        if isprime(n) and digsum(n) = digsum(numtheory[pi](n)) then
            true ;
        else
            false;
        end if;
    end proc:
    A033548 := proc(n)
        local p, k;
        if n = 1 then
            131;
        else
            p := nextprime(procname(n-1)) ;
            while true  do
                if isA033548(p) then
                    return p;
                end if;
                p := nextprime(p) ;
            end do:
        end if;
    end proc:
    seq(A033548(n),n=1..40) ; # R. J. Mathar, Jul 07 2021
  • Mathematica
    Prime[ Select[ Range[ 2000 ], Apply[ Plus, IntegerDigits[ # ] ] == Apply[ Plus, IntegerDigits[ Prime[ # ] ] ] & ] ] (* Santi Spadaro, Oct 14 2001 *)
    Select[ Prime@ Range@ 5927, Plus @@ IntegerDigits@ # == Plus @@ IntegerDigits@ PrimePi@ # &]  (* Robert G. Wilson v, Jun 07 2009 *)
    nn=800;Transpose[Select[Thread[{Prime[Range[nn]],Range[nn]}],Total[IntegerDigits[First[#]]]== Total[ IntegerDigits[ Last[#]]]&]][[1]] (* Harvey P. Dale, Jun 13 2011 *)
  • PARI
    is(n)=isprime(n) && sumdigits(n)==sumdigits(primepi(n)) \\ Charles R Greathouse IV, Jun 18 2015
    
  • Python
    from sympy.ntheory.factor_ import digits
    from sympy import primepi, primerange
    print([n for n in primerange(1, 5901) if (sum(digits(n)[1:])==sum(digits(primepi(n))[1:]))]) # Indranil Ghosh, Jun 27 2017, after Charles R Greathouse IV

Formula

a(n) = A000040(A033549(n)). - R. J. Mathar, Jul 07 2021

Extensions

More terms from Robert G. Wilson v, Jun 07 2009