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

A178137 Partial sums of A068148.

Original entry on oeis.org

2, 5, 10, 17, 28, 51, 94, 161, 250, 351, 460, 671, 894, 1127, 1560, 2003, 2680, 3467, 4344, 5231, 6240, 7349, 8472, 9695, 11806, 14027, 16360, 19581, 22904, 26247, 29680, 34247, 39690, 47479, 55356, 64243, 73242, 82243, 91254, 101141, 111042
Offset: 1

Views

Author

Jonathan Vos Post, May 20 2010

Keywords

Comments

Partial sums of primes in which neighboring digits differ at most by 1 (neighbors of 9 are 0 and 8 and 9). The subsequence of primes in this partial sum begins: 5, 17, 2003, 3467, 5231, 7349, 101141, 187367. What is the smallest value in this partial sum (after 5) which is itself a prime in which neighboring digits differ at most by 1? What is the analog in other bases?

Examples

			a(16) = 2 + 3 + 5 + 7 + 11 + 23 + 43 + 67 + 89 + 101 + 109 + 211 + 223 + 233 + 433 + 443 = 2003 is prime.
		

Crossrefs

Cf. A000040, A007504 - Sum of first n primes, A068148.

Programs

  • Mathematica
    Accumulate[Select[Prime[Range[1500]],Max[Abs[Differences[ IntegerDigits[ #]]] /.{9->1}] <2&]] (* Harvey P. Dale, Apr 01 2019 *)

Formula

a(n) = SUM[i=1..n] A068148(i).

A032981 Positive numbers with the property that all pairs of consecutive base-10 digits differ by 0 or 1.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 21, 22, 23, 32, 33, 34, 43, 44, 45, 54, 55, 56, 65, 66, 67, 76, 77, 78, 87, 88, 89, 98, 99, 100, 101, 110, 111, 112, 121, 122, 123, 210, 211, 212, 221, 222, 223, 232, 233, 234, 321, 322, 323, 332, 333, 334, 343, 344, 345
Offset: 1

Views

Author

Keywords

Comments

a(n) = A178403(n+1) for n < 38. - Reinhard Zumkeller, May 27 2010

Crossrefs

Cf. A068148 (primes).

Programs

  • Haskell
    a032981 n = a032981_list !! (n-1)
    a032981_list = map read $ filter f $ map show [1..] :: [Int] where
       f ps = all (`elem` neighbours) $ zipWith ((. return) . (:)) ps (tail ps)
       neighbours = "09" : "90" : zipWith ((. return) . (:))
          (digs ++ tail digs ++ init digs) (digs ++ init digs ++ tail digs)
       digs = "0123456789"
    -- Reinhard Zumkeller, Feb 14 2015
  • Mathematica
    okQ[n_]:=Max[Abs[Last[#]-First[#]]&/@Partition[IntegerDigits[n],2,1]]<2
    Select[Range[350],okQ]  (* Harvey P. Dale, Feb 14 2011 *)

A376425 Numbers whose adjacent digits differ by at most 1 modulo 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 21, 22, 23, 32, 33, 34, 43, 44, 45, 54, 55, 56, 65, 66, 67, 76, 77, 78, 87, 88, 89, 90, 98, 99, 100, 101, 109, 110, 111, 112, 121, 122, 123, 210, 211, 212, 221, 222, 223, 232, 233, 234, 321, 322, 323, 332, 333, 334, 343, 344, 345, 432
Offset: 1

Views

Author

Andrew Howroyd, Sep 22 2024

Keywords

Comments

Neighbors of 9 are 0 and 8.
Except for the initial zero this is a strict subsequence of A252490 which uses the same neighborhood rule for digits but considers an unordered set of digits. The first difference is that 102 is included by A252490 but excluded here.

Examples

			11 is a term because 1 = 1.
32 is a terms because 3 is a neighbor of 2.
109 is a term because 1 is a neighbor of 0 and 0 is a neighbor of 9 (modulo 10).
121 is a term because 1 is a neighbor of 2 and 2 is a neighbor of 1.
		

Crossrefs

Subsequence of A252490 union {0}.

Programs

  • Maple
    f:= proc(n) local i;
       seq(10*n+i,i= sort([n-1,n,n+1] mod 10))
    end proc:
    S:= [$1..9]: R:= 0,op(S):
    for i from 1 to 3 do
      S:= map(f,S); R:= R,op(S)
    od:
    R; # Robert Israel, Sep 22 2024
  • PARI
    isok(k)={my(v=digits(k)); for(i=2, #v, my(t=abs(v[i]-v[i-1])); if(t>1&&t<9, return(0))); 1}

Formula

From Robert Israel, Sep 22 2024 (Start):
Let a(n) mod 10 = d.
If 1 <= d <= 8 then a(3 n + 6 + j) = 10 a(n) + d + j for j = -1, 0, 1.
If d = 0 and n > 1, then a(3 n + 5) = 10 a(n), a(3 n + 6) = 10 a(n) + 1, a(3 n + 7) = 10 a(n) + 9.
If d = 9, then a(3 n + 5) = 10 a(n), a(3 n + 6) = 10 a(n) + 8, a(3 n + 7) = 10 a(n) + 9.
(End)
Showing 1-3 of 3 results.