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.

A362417 Beginning with 1, smallest positive integer not yet in the sequence such that two adjacent digits A and B of the sequence (also ignoring commas between terms) produce a prime = A + 2B. This is the earliest infinitely extensible such sequence.

This page as a plain text file.
%I A362417 #28 Apr 23 2023 17:11:21
%S A362417 1,3,5,7,20,11,9,13,15,19,50,111,30,113,51,31,35,37,53,57,59,70,115,
%T A362417 73,75,91,95,97,201,119,120,130,131,135,137,301,150,151,153,157,311,
%U A362417 159,191,195,197,313,501,315,319,511,320,1111,350,1113,513,515,351,353
%N A362417 Beginning with 1, smallest positive integer not yet in the sequence such that two adjacent digits A and B of the sequence (also ignoring commas between terms) produce a prime = A + 2B. This is the earliest infinitely extensible such sequence.
%C A362417 The integer 10 is the first one that will never appear in the sequence (as the result of 1 + 2*0 is not a prime). The next absent will be 14.
%C A362417 From _Michael S. Branicky_, Apr 19 2023: (Start)
%C A362417 The only allowed pairs of digits AB are 01, 11, 12, 13, 15, 16, 18, 19, 20, 30, 31, 32, 34, 35, 37, 38, 50, 51, 53, 54, 56, 57, 59, 70, 72, 73, 75, 76, 78, 91, 92, 94, 95, 97.
%C A362417 Further, any appearance of 4, 6, or 8 as a digit would end the sequence, as would a term with last digit 2 (since the next term cannot start with 0).
%C A362417 As long as no term ends in 2, 4, 6, or 8, the sequence is infinitely extensible since the edge and cycle 01 -> 13 -> 31 -> 13 (at least) can be used to extend terms ending in 0, 1, or 3; and 75 -> 59 -> 97 to extend terms ending in 5, 7, or 9. (End)
%e A362417 Digit A = 1 and B = 3 lead to 7 (prime) = A+2B;
%e A362417 Digit A = 3 and B = 5 lead to 13 (prime) = A+2B;
%e A362417 Digit A = 5 and B = 7 lead to 19 (prime) = A+2B;
%e A362417 Digit A = 7 and B = 2 lead to 11 (prime) = A+2B;
%e A362417 Digit A = 2 and B = 0 lead to 2 (prime) = A+2B;
%e A362417 Digit A = 0 and B = 1 lead to 2 (prime) = A+2B;
%e A362417 Digit A = 1 and B = 1 lead to 3 (prime) = A+2B; etc.
%o A362417 (Python)
%o A362417 from sympy import isprime
%o A362417 from itertools import islice
%o A362417 def c(s):
%o A362417     if s[-1] == "2" or "4" in s or "6" in s or "8" in s: return False
%o A362417     return all(isprime(int(s[i])+2*int(s[i+1])) for i in range(len(s)-1))
%o A362417 def agen(): # generator of terms
%o A362417     last, aset = "1", {1}
%o A362417     yield 1
%o A362417     while True:
%o A362417         k = 2
%o A362417         while k in aset or not c(last+str(k)): k += 1
%o A362417         an = k; yield an; last += str(an); aset.add(an)
%o A362417 print(list(islice(agen(), 58))) # _Michael S. Branicky_, Apr 19 2023
%Y A362417 Cf. A182178 (B is multiplied by 1), A362418 (B is multiplied by 3).
%K A362417 base,nonn
%O A362417 1,2
%A A362417 _Eric Angelini_, Apr 19 2023
%E A362417 a(7) inserted and a(30) and beyond from _Michael S. Branicky_, Apr 19 2023