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.

A089824 Primes p such that the next prime after p can be obtained from p by adding the sum of the digits of p.

This page as a plain text file.
%I A089824 #14 Dec 07 2024 19:30:03
%S A089824 11,13,101,103,181,293,631,701,811,1153,1171,1409,1801,1933,2017,2039,
%T A089824 2053,2143,2213,2521,2633,3041,3089,3221,3373,3391,3469,3643,3739,
%U A089824 4057,4231,5153,5281,5333,5449,5623,5717,6053,6121,6301,7043,7333,8101,8543,9241
%N A089824 Primes p such that the next prime after p can be obtained from p by adding the sum of the digits of p.
%C A089824 I call these primes (additive) "pointer primes", in the sense that such primes p "point" to the next prime after p when the sum of the digits of p is added to p.
%H A089824 Alois P. Heinz, <a href="/A089824/b089824.txt">Table of n, a(n) for n = 1..10000</a>
%e A089824 13 + sum of digits of 13 = 17, which is the next prime after 13. Hence 13 belongs to the sequence.
%p A089824 a:= proc(n) option remember; local p, q;
%p A089824       p:= a(n-1); q:= nextprime(p);
%p A089824       do p:= q; q:= nextprime(p);
%p A089824          if add(i, i=convert(p, base, 10))=q-p then break fi
%p A089824       od; p
%p A089824     end: a(1):= 11:
%p A089824 seq(a(n), n=1..50);  # _Alois P. Heinz_, Nov 18 2017
%t A089824 r = {}; Do[p = Prime[i]; q = Prime[i + 1]; If[p + Apply[Plus, IntegerDigits[p]] == q, r = Append[r, p]], {i, 1, 10^6}]; r
%t A089824 Transpose[Select[Partition[Prime[Range[1000]],2,1],#[[2]]==#[[1]]+Total[ IntegerDigits[ #[[1]]]]&]][[1]] (* _Harvey P. Dale_, Apr 20 2013 *)
%o A089824 (Python)
%o A089824 from sympy import isprime, nextprime
%o A089824 def ok(n): return isprime(n) and sum(map(int, str(n))) + n == nextprime(n)
%o A089824 print([k for k in range(10**4) if ok(k)]) # _Michael S. Branicky_, Dec 07 2024
%K A089824 base,nonn
%O A089824 1,1
%A A089824 _Joseph L. Pe_, Jan 09 2004