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.

Previous Showing 11-14 of 14 results.

A385702 Numbers such that when the leftmost digit is moved to the unit's place the result is divisible by 7.

Original entry on oeis.org

0, 7, 12, 19, 24, 36, 41, 48, 53, 65, 70, 77, 82, 89, 94, 102, 109, 116, 123, 130, 137, 144, 151, 158, 165, 172, 179, 186, 193, 204, 211, 218, 225, 232, 239, 246, 253, 260, 267, 274, 281, 288, 295, 306, 313, 320, 327, 334, 341, 348, 355, 362, 369, 376, 383, 390, 397
Offset: 1

Views

Author

Stefano Spezia, Jul 07 2025

Keywords

Examples

			376 is a term since 763 = 109*7 is divisible by 7.
		

Crossrefs

Similar sequences for k=1..9: A001477, A273892, A008585, A385700, A217398, A385701, this sequence, A385703, A008591.

Programs

  • Mathematica
    Select[Range[0,400],Divisible[FromDigits[RotateLeft[IntegerDigits[#]]],7] &]
  • PARI
    isok(k) = if (k==0, return(1)); my(d=digits(k), v = vector(#d-1, i, d[i+1])); v = concat(v, d[1]); fromdigits(v) % 7 == 0; \\ Michel Marcus, Jul 08 2025
    
  • Python
    def ok(n): return int((s:=str(n))[1:]+s[0])%7 == 0
    print([k for k in range(400) if ok(k)]) # Michael S. Branicky, Jul 08 2025

A385703 Numbers such that when the leftmost digit is moved to the unit's place the result is divisible by 8.

Original entry on oeis.org

0, 8, 23, 27, 42, 46, 61, 65, 69, 80, 84, 88, 203, 207, 211, 215, 219, 223, 227, 231, 235, 239, 243, 247, 251, 255, 259, 263, 267, 271, 275, 279, 283, 287, 291, 295, 299, 402, 406, 410, 414, 418, 422, 426, 430, 434, 438, 442, 446, 450, 454, 458, 462, 466, 470, 474
Offset: 1

Views

Author

Stefano Spezia, Jul 07 2025

Keywords

Examples

			458 is a term since 584 = 73*8 is divisible by 8.
		

Crossrefs

Similar sequences for k=1..9: A001477, A273892, A008585, A385700, A217398, A385701, A385702, this sequence, A008591.

Programs

  • Mathematica
    Select[Range[0,475],Divisible[FromDigits[RotateLeft[IntegerDigits[#]]],8] &]
  • PARI
    isok(k) = if (k==0, return(1)); my(d=digits(k), v = vector(#d-1, i, d[i+1])); v = concat(v, d[1]); fromdigits(v) % 8 == 0; \\ Michel Marcus, Jul 08 2025
    
  • Python
    def ok(n): return int((s:=str(n))[1:]+s[0])%8 == 0
    print([k for k in range(500) if ok(k)]) # Michael S. Branicky, Jul 08 2025

A143473 Replace the leading digit d of n with 10-d (in decimal representation).

Original entry on oeis.org

10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 30, 31
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 18 2008

Keywords

Comments

a(n) = n iff A000030(n) = 5, cf. A217398.

Programs

  • Haskell
    a143473 n = foldl (\v d -> 10 * v + d) 0 $ (10 - z) : zs where
       (z:zs) = map (read . return) $ show n
  • Mathematica
    ld10[n_]:=Module[{idn=IntegerDigits[n]},FromDigits[Join[{10-idn[[1]]},Rest[ idn]]]]; Array[ld10,100,0] (* Harvey P. Dale, May 25 2020 *)

Formula

A000030(a(n)) = 10 - A000030(n).

A341909 a(0) = 0; for n > 0, a(n) is the smallest positive integer not yet in the sequence such that the first digit of a(n) differs by 1 from the last digit of a(n-1).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 80, 10, 11, 20, 12, 13, 21, 22, 14, 30, 15, 40, 16, 50, 17, 60, 18, 70, 19, 81, 23, 24, 31, 25, 41, 26, 51, 27, 61, 28, 71, 29, 82, 32, 33, 42, 34, 35, 43, 44, 36, 52, 37, 62, 38, 72, 39, 83, 45, 46, 53, 47, 63, 48, 73, 49, 84, 54, 55, 64, 56, 57, 65, 66, 58, 74, 59
Offset: 0

Views

Author

Scott R. Shannon, Feb 23 2021

Keywords

Examples

			a(10) = 80 as the last digit of a(9) = 9 is 9, thus the first digit of a(10) must be 8. As 8 has already been used the next smallest number starting with 8 is 80.
a(16) = 21 as the last digit of a(15) = 13 is 3, thus the first digit of a(16) must be 2 or 4. As 2, 4 and 20 have already been used the next smallest number starting with 2 is 21.
		

Crossrefs

Programs

  • Mathematica
    Block[{a = {0}, k}, Do[k = 1; While[Nand[FreeQ[a, k], Abs[First@ IntegerDigits[k] - Mod[a[[-1]], 10]] == 1], k++]; AppendTo[a, k], {i, 76}]; a] (* Michael De Vlieger, Feb 23 2021 *)
  • Python
    def nextd(strn, d):
      n = int(strn) if strn != "" else 0
      return n+1 if str(n+1)[0] == str(d) else int(str(d)+'0'*len(strn))
    def aupton(term):
      alst, aset = [0], {0}
      lastdstr = ["" for d in range(10)]
      for n in range(1, term+1):
        lastdig = alst[-1]%10
        firstdigs = set([max(lastdig-1, 0), min(lastdig+1, 9)]) - {0}
        cands = [nextd(lastdstr[d], d) for d in firstdigs]
        m = min(cands)
        argmin = cands.index(m)
        alst.append(m)
        strm = str(m)
        lastdstr[int(strm[0])] = strm
      return alst
    print(aupton(76)) # Michael S. Branicky, Feb 23 2021
Previous Showing 11-14 of 14 results.