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.

A252357 Numbers n of the form p^m where p is prime and m>0 such that the digit sum of n is p.

This page as a plain text file.
%I A252357 #14 Dec 22 2014 04:20:04
%S A252357 2,3,5,7,2401,4913,27512614111,271818611107,1174711139837,
%T A252357 45848500718449031,73742412689492826049,21048519522998348950643,
%U A252357 146853371345156431381127623,240984500018808097135911707,283956682347124706942551243009,2759031540715333904109053133443
%N A252357 Numbers n of the form p^m where p is prime and m>0 such that the digit sum of n is p.
%C A252357 Subsequence of A000961.
%C A252357 The corresponding values of the primes p are 2, 3, 5, 7, 7, 17, 31, 43, 53, 71, 97, 107, 103, 107, 127, 107, ... .
%C A252357 The corresponding values of the powers m are 1, 1, 1, 1, 4, 3, 7, 7, 7, 9, 10, 11, 13, 13, 14, 15, ... .
%e A252357 2401 is in the sequence because 2401 = 7^4 and 2+4+0+1 = 7.
%p A252357 nn:=2000:
%p A252357 for p from 1 to 15 do :
%p A252357 for m from 1 to nn do:n:=ithprime(m)^p:
%p A252357 y:=convert(n,base,10):n1:=nops(y):
%p A252357 s1:=sum('y[i]', 'i'=1..n1):
%p A252357 if s1=ithprime(m)
%p A252357   then
%p A252357    printf(`%d, `,n):
%p A252357    else
%p A252357    fi:
%p A252357   od:
%p A252357 od:
%t A252357 a252357[n_Integer] :=
%t A252357 Select[Range[n],
%t A252357   PrimeQ[Plus @@ IntegerDigits[#]] &&
%t A252357 IntegerQ[Log[Plus @@ IntegerDigits[#], #]] &]; a252357[10^5] (* _Michael De Vlieger_, Dec 17 2014 *)
%Y A252357 Cf. A000961, A212667.
%K A252357 nonn,base
%O A252357 1,1
%A A252357 _Michel Lagneau_, Dec 17 2014