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-4 of 4 results.

A219248 Numbers such that the absolute difference of any two adjacent (decimal) digits is prime.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 13, 14, 16, 18, 20, 24, 25, 27, 29, 30, 31, 35, 36, 38, 41, 42, 46, 47, 49, 50, 52, 53, 57, 58, 61, 63, 64, 68, 69, 70, 72, 74, 75, 79, 81, 83, 85, 86, 92, 94, 96, 97, 130, 131, 135, 136, 138, 141, 142, 146, 147, 149, 161, 163, 164
Offset: 1

Views

Author

M. F. Hasler, Apr 12 2013

Keywords

Comments

Numbers which may (and do) occur in A219250 and A219249 (union {0}).
This is to A219250 and A219249 what A182175 is to A182177 and A182178.

Programs

  • Mathematica
    Select[Range[0,200],And@@PrimeQ[Abs[Differences[IntegerDigits[#]]]]&] (* Harvey P. Dale, Jun 06 2014 *)
  • PARI
    is_A219248(n)={!for(i=2,#n=digits(n),isprime(abs(n[i-1]-n[i]))||return)}
    
  • Python
    def ok(n):
        d = list(map(int, str(n)))
        return all(abs(d[i]-d[i-1]) in {2,3,5,7} for i in range(1, len(d)))
    print([k for k in range(164) if ok(k)]) # Michael S. Branicky, Sep 11 2024
    
  • Python
    from itertools import count, islice
    def A219248gen(seed=None): # generator of terms
        nxt = {None:"123456789", "0":"2357", "1":"3468", "2":"04579",
            "3":"01568", "4":"12679", "5":"02378", "6":"13489",
            "7":"02459", "8":"1356", "9":"2467"}
        def bgen(d, seed=None):
            if d == 0: yield tuple(); return
            yield from ((i,)+t for i in nxt[seed] for t in bgen(d-1, seed=i))
        yield 0
        for d in count(1):
            yield from (int("".join(t)) for t in bgen(d, seed=seed))
    print(list(islice(A219248gen(), 65))) # Michael S. Branicky, Sep 11 2024

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))}
Showing 1-4 of 4 results.