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.

A117477 Primes whose SOD and that of their indices are both prime and equal (indices may not be prime, but their SOD must be prime).

This page as a plain text file.
%I A117477 #13 Apr 21 2024 11:15:19
%S A117477 131,263,1039,1091,1301,1361,1433,2221,2441,2591,2663,2719,2803,3433,
%T A117477 3631,4153,4357,4397,5507,5701,5741,5927,6311,6353,6553,6737,6827,
%U A117477 6971,7013,7213,7411,7523,7741,8821,9103,11173,11353,11731,11821,12277,12347
%N A117477 Primes whose SOD and that of their indices are both prime and equal (indices may not be prime, but their SOD must be prime).
%C A117477 "SOD" = "sum of digits".
%C A117477 This sequence is a subset of A033548, the difference being that this sequence requires prime SODs.
%H A117477 Harvey P. Dale, <a href="/A117477/b117477.txt">Table of n, a(n) for n = 1..1000</a>
%F A117477 Find primes whose indices, when SODs are computed, are both prime and SOD(i) = SOD(p)
%e A117477 a(3) = 1039, the 175th prime. Both the SOD of the index and the prime are prime and equal: 13 = 13.
%t A117477 sodQ[{n_,p_}]:=Module[{sodn=Total[IntegerDigits[n]],sodp=Total[IntegerDigits[p]]},AllTrue[ {sodn,sodp},PrimeQ] && sodn == sodp]; Select[With[{nn=1500},Table[{n,Prime[n]},{n,nn}]],sodQ][[;;,2]] (* _Harvey P. Dale_, Apr 20 2024 *)
%o A117477 (UBASIC)
%o A117477 20 'SOD prime index and SOD prime
%o A117477 30 Y=1
%o A117477 40 Y=nxtprm(Y)
%o A117477 50 C=C+1:print C;Y;"-";
%o A117477 60 D=str(C):Z=str(Y)
%o A117477 70 E=len(D):F=len(Z)
%o A117477 80 for Q=2 to E
%o A117477 90 A=mid(D,Q,1):G=val(A)
%o A117477 100 I=I+G:print I;
%o A117477 110 next Q
%o A117477 120 for R=2 to F
%o A117477 130 B=mid(Z,R,1):H=val(B)
%o A117477 140 J=J+H:print J;
%o A117477 150 next R
%o A117477 160 if I=prmdiv(I) and J=prmdiv(J) and I=J then stop
%o A117477 170 I=0:J=0
%o A117477 180 goto 40
%Y A117477 Cf. A117478, A033548-A033549, A117458-A117463.
%K A117477 easy,nonn,base
%O A117477 1,1
%A A117477 _Enoch Haga_, Mar 19 2006