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.

Showing 1-6 of 6 results.

A182175 Numbers with the property that every pair of adjacent digits sum to a prime number.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 14, 16, 20, 21, 23, 25, 29, 30, 32, 34, 38, 41, 43, 47, 49, 50, 52, 56, 58, 61, 65, 67, 70, 74, 76, 83, 85, 89, 92, 94, 98, 111, 112, 114, 116, 120, 121, 123, 125, 129, 141, 143, 147, 149, 161, 165, 167, 202, 203, 205, 207, 211, 212, 214, 216, 230, 232, 234
Offset: 1

Views

Author

Jim Nastos, Apr 16 2012

Keywords

Comments

Complement of A219110. - M. F. Hasler, Apr 11 2013

Examples

			983 is in the sequence since 9+8 is prime and 8+3 is prime.
		

Crossrefs

These are the candidate numbers for extending A182178.
Cf. A219110.

Programs

  • Maple
    N:= 4: # to get all terms with up to N digits.
    for p from 0 to 9 do P[p]:= select(t -> isprime(t+p),[$0..9]) od:
    F:= proc(t) local r,p; r:= t mod 10; op(map(`+`,P[r],10*t)) end proc:
    S[1]:= {$1..9}:
    for j from 2 to N do S[j]:= map(F,S[j-1]) od:
    `union`({0},seq(S[j],j=1..N));
    # if using Maple 11 or lower, uncomment the next line:
    # sort(convert(%,list));
    # Robert Israel, Oct 27 2014
  • Mathematica
    fQ[n_] := Module[{d = IntegerDigits[n], s}, s = Most[d] + Rest[d]; And @@ PrimeQ[s]]; Flatten[Join[{Range[0,9],Select[Range[11, 300], fQ]}]] (* T. D. Noe, Aug 21 2012 and Apr 17 2013; modified by Zak Seidov, Oct 28 2014 *)
  • PARI
    is_A182175(n)=!for(i=2, #n=digits(n), isprime(n[i-1]+n[i])||return) \\ M. F. Hasler, Oct 27 2014

A182178 Beginning with 1, smallest positive integer not yet in the sequence such that two adjacent digits of the sequence (also ignoring commas between terms) sum to a prime.

Original entry on oeis.org

1, 2, 3, 4, 7, 6, 5, 8, 9, 20, 21, 11, 12, 14, 16, 50, 23, 25, 29, 41, 43, 47, 49, 83, 85, 61, 65, 67, 411, 111, 112, 30, 32, 34, 38, 52, 56, 58, 92, 94, 70, 74, 76, 114, 98, 302, 116, 120, 202, 121, 123, 89, 203, 205, 207, 412, 125, 211, 129, 212, 141, 143
Offset: 1

Views

Author

Jim Nastos and Eric Angelini, Apr 16 2012

Keywords

Comments

See A219110 for the numbers which do not occur in this sequence. See A219250 for the analog when "sum" is replaced with "absolute difference", and A219248-A219251 for related sequences. - M. F. Hasler, Apr 11 2013

Examples

			20 follows 9 since 9+2 and 2+0 is prime, and no number less than 20 (not already in the sequence) satisfies the stated property.
		

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = For[id = IntegerDigits[a[n-1]]; k = 1, True, k++, If[FreeQ[Array[a, n-1], k], dd = Join[id, IntegerDigits[k]]; If[And @@ PrimeQ /@ Plus @@@ Transpose[{Most[dd], Rest[dd]}], Return[k]]]]; Array[a, 62] (* Jean-François Alcover, Apr 17 2013 *)
  • PARI
    A182178_vec={(n, a=[1], u=0)->while(#aM. F. Hasler, Apr 11 2013

A219250 Lexicographically earliest sequence of nonnegative integers such that the absolute difference of any two adjacent digits is prime.

Original entry on oeis.org

0, 2, 4, 1, 3, 5, 7, 9, 6, 8, 13, 14, 16, 18, 30, 20, 24, 25, 27, 29, 41, 31, 35, 36, 38, 50, 52, 42, 46, 47, 49, 61, 63, 53, 57, 58, 64, 68, 69, 70, 72, 74, 75, 79, 202, 92, 94, 96, 81, 83, 85, 86, 97, 203, 130, 205, 207, 241, 302, 413, 131, 303, 135, 242, 414, 136, 138, 141, 305, 246, 142, 416, 146, 147, 247, 249
Offset: 1

Views

Author

M. F. Hasler, Apr 11 2013

Keywords

Comments

See A219249 for the version allowing only positive integers, i.e., starting with a(1)=1.
See A219248 (= range of A219250) for the numbers which occur in this sequence, and A219251 for the complement.
A182177 is the analog of this sequence for replacing "absolute difference" by "sum", A182178 is the same analog for A219249; A182175 is the analog of A219248 and A219110 corresponds to A219251.

Programs

  • PARI
    {(n,a=[0],u=0)->while(#a
    				

A182177 Beginning with 0, smallest positive integer not yet in the sequence such that two adjacent digits of the sequence (also ignoring commas between terms) sum to a prime.

Original entry on oeis.org

0, 2, 1, 4, 3, 8, 5, 6, 7, 41, 11, 12, 9, 20, 21, 14, 16, 50, 23, 25, 29, 43, 47, 49, 83, 85, 61, 65, 67, 411, 111, 112, 30, 32, 34, 38, 52, 56, 58, 92, 94, 70, 74, 76, 114, 98, 302, 116, 120, 202, 121, 123, 89, 203, 205, 207, 412, 125, 211, 129, 212, 141, 143, 214, 147, 414, 149, 216, 161, 165, 230, 232, 167, 416, 502, 303, 234, 305, 238, 307, 430, 250, 252, 320, 256, 503, 258, 321, 292, 323, 294, 325, 298, 329, 432, 341, 434, 343, 438, 347, 470, 349
Offset: 1

Views

Author

Jim Nastos and Eric Angelini, Apr 16 2012

Keywords

Comments

A219250 is the analog of this sequence, replacing "sum" by "absolute difference". A219249 is the same analog for A182178. A219248 is the analog of A182175 and A219251 corresponds to A219110 = terms which do not occur in this sequence, i.e., the complement of its range. - M. F. Hasler, Apr 12 2013

Examples

			41 appears after 7 because 7+4 is prime and 4+1 is prime, and no other number less than 41 (not already in the sequence) satisfies this property. Example: 11 does not directly follow 7 since 7+1 is not prime.
		

Crossrefs

Cf. A182175.

Programs

  • PARI
    A182177_vec={(n, a=[0], u=0)->while(#aM. F. Hasler, Apr 11 2013

A219251 Numbers such that the absolute difference of a pair of adjacent decimal digits is not prime.

Original entry on oeis.org

10, 11, 12, 15, 17, 19, 21, 22, 23, 26, 28, 32, 33, 34, 37, 39, 40, 43, 44, 45, 48, 51, 54, 55, 56, 59, 60, 62, 65, 66, 67, 71, 73, 76, 77, 78, 80, 82, 84, 87, 88, 89, 90, 91, 93, 95, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129
Offset: 1

Views

Author

M. F. Hasler, Apr 11 2013

Keywords

Comments

Complement of A219248; numbers which do not occur in A219249 and A219250; analog of what is A219110 to A182177, A182178.

Programs

  • PARI
    is_A219251(n)={for(i=2, #n=digits(n), isprime(abs(n[i-1]-n[i]))||return(1))}

A346786 If a(n) is prime, then a(n) + a(n+1) is prime; if a(n) is not prime, then a(n) + a(n+1) is not prime. This is also true for pairs of consecutive digits: if the first one is prime, the sum of the pair is also prime; if the first one is nonprime, the sum of the pair is nonprime. This is the lexicographically earliest sequence of distinct terms > 0 with this property.

Original entry on oeis.org

2, 1, 3, 4, 5, 6, 8, 7, 40, 9, 13, 46, 20, 10, 15, 21, 30, 18, 17, 42, 32, 19, 34, 23, 44, 25, 29, 38, 48, 45, 60, 62, 50, 64, 52, 56, 63, 80, 66, 68, 70, 82, 58, 74, 69, 76, 84, 81, 87, 401, 86, 88, 100, 90, 93, 201, 91, 95, 200, 96, 99, 97, 406, 204, 206, 208, 101, 300
Offset: 1

Views

Author

Eric Angelini and Carole Dubois, Aug 03 2021

Keywords

Examples

			a(1) = 2 (prime) and a(1) + a(2) = 2 + 1 = 3 [which is prime, like a(1)];
a(2) = 1 (nonprime) and a(2) + a(3) = 1 + 3 = 4 [which is nonprime, like a(2)];
a(3) = 3 (prime) and a(3) + a(4) = 3 + 4 = 7 [which is prime, like a(3)];
a(4) = 4 (nonprime) and a(4) + a(5) = 4 + 5 = 9 [which is nonprime, like a(4)];
a(5) = 5 (prime) and a(5) + a(6) = 5 + 6 = 11 [which is prime, like a(5)];
(...)
a(8) = 7 (prime) and a(8) + a(9) = 7 + 40 = 47 [which is prime, like a(8)];
now we have to consider also the digits of the pair (7,4); they are "7", the last digit of a(8), and "4", the first digit of a(9): as the first digit of the pair is prime (7), the sum of this 7 and the next digit (4) has to be prime too, which is the case, 4 + 7 = 11;
a(9) = 40 (nonprime) and a(9) + a(10) = 40 + 9 = 49 [which is nonprime, like a(9)];
the next pair of digits we have to consider after (7,4) is (4,0); as 4 is nonprime, so has to be the sum 4 + 0 (which is the case as 4 + 0 = 4); etc.
		

Crossrefs

Cf. A219110.

Programs

  • Mathematica
    t[x_,y_]:=If[PrimeQ@x,PrimeQ[x+y],!PrimeQ[x+y]];a[1]=2;a[n_]:=a[n]=Block[{k=1},While[MemberQ[Array[a,n-1],k]||!And@@(t@@@Partition[Flatten[IntegerDigits/@Join[Array[a,n-1],{k}]],2,1])||!t@@{a[n-1],k},k++];k];Array[a,68] (* Giorgos Kalogeropoulos, May 09 2022 *)
Showing 1-6 of 6 results.