login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A179920 Smallest n-digit prime such that the sum of the square of digits equals n, or 0 if no such prime exists. 0
0, 11, 0, 0, 0, 102001, 1000121, 0, 100012111, 1000111121, 10000000103, 100000021211, 1000000011103, 10000000113011, 100000000001203, 1000000000021103, 10000000001222111, 100000000000002203, 1000000000000122221 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

Table of n, a(n) for n=1..19.

EXAMPLE

a(6) = 102001 because 1^2+0^2+2^2+0^2+0^2+1^2 = 6 = number of digits.

MAPLE

with(numtheory):Digits:=25:for k from 0 to 10 do: id:=0:for n from 10^k to

  10^(k+1)-1while(id=0) do:l:=length(n):n0:=n:s:=0:for m from 1 to l do:q:=n0:u:=irem(q,

  10):v:=iquo(q, 10):n0:=v :s:=s+u^2:od: if s=l and type(n, prime)=true then id:=1:print(n):else

  fi:od:od:

CROSSREFS

Cf. A073864

Sequence in context: A279540 A113043 A110408 * A216726 A138066 A173189

Adjacent sequences:  A179917 A179918 A179919 * A179921 A179922 A179923

KEYWORD

nonn,base

AUTHOR

Michel Lagneau, Jan 12 2011

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified July 22 18:10 EDT 2017. Contains 289671 sequences.