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.

A048398 Primes with consecutive digits that differ exactly by 1.

This page as a plain text file.
%I A048398 #32 May 31 2017 22:44:51
%S A048398 2,3,5,7,23,43,67,89,101,787,4567,12101,12323,12343,32321,32323,34543,
%T A048398 54323,56543,56767,76543,78787,78989,210101,212123,234323,234343,
%U A048398 432121,432323,432343,434323,454543,456767,654323,654343,678767,678989
%N A048398 Primes with consecutive digits that differ exactly by 1.
%C A048398 Or, primes in A033075. - _Zak Seidov_, Feb 01 2011
%D A048398 J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 67, p. 23, Ellipses, Paris 2008.
%H A048398 Chai Wah Wu, <a href="/A048398/b048398.txt">Table of n, a(n) for n = 1..10000</a> (terms n = 1..1500 from Zak Seidov)
%t A048398 Select[Prime[Range[10000]], # < 10 || Union[Abs[Differences[IntegerDigits[#]]]] == {1} &]
%o A048398 (Haskell)
%o A048398 a048398 n = a048398_list !! (n-1)
%o A048398 a048398_list = filter ((== 1) . a010051') a033075_list
%o A048398 -- _Reinhard Zumkeller_, Feb 21 2012, Nov 04 2010
%o A048398 (Python 3.2 or higher)
%o A048398 from itertools import product, accumulate
%o A048398 from sympy import isprime
%o A048398 A048398_list = [2,3,5,7]
%o A048398 for l in range(1,17):
%o A048398     for d in [1,3,7,9]:
%o A048398         dlist = [d]*l
%o A048398         for elist in product([-1,1],repeat=l):
%o A048398             flist = [str(d+e) for d,e in zip(dlist,accumulate(elist)) if 0 <= d+e < 10]
%o A048398             if len(flist) == l and flist[-1] != '0':
%o A048398                 n = 10*int(''.join(flist[::-1]))+d
%o A048398                 if isprime(n):
%o A048398                     A048398_list.append(n)
%o A048398 A048398_list = sorted(A048398_list) # _Chai Wah Wu_, May 31 2017
%Y A048398 Cf. A033075, A048399-A048405, A052016, A052017, A006055.
%Y A048398 Cf. A010051; intersection of A033075 and A000040.
%K A048398 nonn,base
%O A048398 1,1
%A A048398 _Patrick De Geest_, Apr 15 1999