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.

A177149 Indices n such that the sums of the squares of the digits of prime(n) are prime.

Original entry on oeis.org

5, 9, 13, 18, 23, 26, 30, 32, 33, 40, 41, 43, 45, 46, 48, 50, 64, 65, 66, 67, 68, 71, 74, 75, 78, 79, 80, 86, 87, 89, 90, 91, 110, 116, 117, 118, 121, 124, 128, 130, 131, 137, 139, 145, 150, 153, 156, 157, 159, 164, 165, 167, 168, 170, 171, 173, 174, 182, 184, 185
Offset: 1

Views

Author

Michel Lagneau, May 03 2010

Keywords

Comments

n such that prime(n) is in A108662. - Robert Israel, Aug 05 2019

Examples

			5 is in the sequence because the 5th prime is 11, and 1^2 + 1^2 = 2 prime;
9 is in the sequence because the 9th prime is 23, and 2^2 + 3^2 = 13 prime;
139 is in the sequence because the 139th prime is 797, and 7^2 + 9^2 + 7^2 =179 prime.
		

Crossrefs

Cf. A108662.

Programs

  • Maple
    with(numtheory): nn:= 150: T:=array(1..nn):k:=1:for n from 1 to 731 do:p:=ithprime(n):l:=evalf(floor(ilog10(p))+1):n0:=p: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 type(s,prime)=true then T[k]:=n:k:=k+1: else fi:od:print(T):
    # Simpler:
    filter:= proc(n) isprime(add(t^2,t=convert(ithprime(n),base,10))) end proc:
    select(filter, [$1..1000]); # Robert Israel, Aug 05 2019
  • Mathematica
    Select[Range[200],PrimeQ[Total[IntegerDigits[Prime[#]]^2]]&] (* Harvey P. Dale, Jan 10 2021 *)