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

A248043 Inverse permutation to A248024.

Original entry on oeis.org

1, 3, 6, 13, 11, 16, 9, 27, 32, 2, 4, 5, 7, 8, 10, 12, 14, 15, 17, 19, 20, 22, 23, 26, 28, 30, 31, 36, 37, 21, 33, 39, 45, 46, 50, 53, 54, 56, 61, 40, 41, 52, 58, 65, 66, 69, 74, 80, 81, 29, 49, 51, 63, 67, 72, 73, 78, 88, 94, 68, 90, 99, 102, 113, 122, 130
Offset: 1

Views

Author

Reinhard Zumkeller, Sep 30 2014

Keywords

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a248043 = (+ 1) . fromJust . (`elemIndex` a248024_list)

A248025 Lexicographically earliest permutation of the positive integers such that the first digit of a(n+1) is the digital root of a(n).

Original entry on oeis.org

1, 10, 11, 2, 20, 21, 3, 30, 31, 4, 40, 41, 5, 50, 51, 6, 60, 61, 7, 70, 71, 8, 80, 81, 9, 90, 91, 12, 32, 52, 72, 92, 22, 42, 62, 82, 13, 43, 73, 14, 53, 83, 23, 54, 93, 33, 63, 94, 44, 84, 34, 74, 24, 64, 15, 65, 25, 75, 35, 85, 45, 95, 55, 16, 76, 46, 17, 86, 56, 26, 87, 66, 36, 96
Offset: 1

Views

Author

Eric Angelini and M. F. Hasler, Sep 29 2014

Keywords

Crossrefs

Cf. A010888 (digital root); similar sequences: A248024,...
Cf. A247879 (inverse), A000030.

Programs

  • Haskell
    import Data.List (delete)
    a248025 n = a248025_list !! (n-1)
    a248025_list = 1 : f 1 [2..] where
      f x zs = g zs where
        g (y:ys) = if a000030 y == a010888 x
                   then y : f y (delete y zs) else g ys
    -- Reinhard Zumkeller, Sep 30 2014
  • Mathematica
    Nest[Append[#, Block[{k = 1, r = Mod[#[[-1]], 9] + 9 Boole[Mod[#[[-1]], 9] == 0]}, While[Nand[FreeQ[#, k], IntegerDigits[k][[1]] == r], k++]; k]] &, {1}, 73] (* Michael De Vlieger, Oct 15 2020 *)
  • PARI
    a(n,S=1,u=2)={for(i=1,n,print1(S",");S=(S-1)%9+1;for(k=1,9e9,bittest(u,k)&&next;S==digits(k)[1]||next;u+=1<
    				

A308539 Lexicographically earliest sequence of distinct positive terms such that for any n > 0, the initial digit of a(n) divides a(n+1).

Original entry on oeis.org

1, 2, 4, 8, 16, 3, 6, 12, 5, 10, 7, 14, 9, 18, 11, 13, 15, 17, 19, 20, 22, 24, 26, 28, 30, 21, 32, 27, 34, 33, 36, 39, 42, 40, 44, 48, 52, 25, 38, 45, 56, 35, 51, 50, 55, 60, 54, 65, 66, 72, 49, 64, 78, 63, 84, 80, 88, 96, 81, 104, 23, 46, 68, 90, 99, 108, 29
Offset: 1

Views

Author

Rémy Sigrist, Jun 06 2019

Keywords

Comments

This sequence is a permutation of the natural numbers (with inverse A308541):
- for any nonzero digit d, there are infinitely many multiples of d, hence we can always extend the sequence,
- by the pigeonhole principle, for some nonzero digit t, there are infinitely many terms with initial digit t,
- so eventually every multiple of t will appear in the sequence,
- after a term with initial digit 1, we can always extend the sequence with the least natural number not yet in the sequence,
- as there are infinitely many multiples of t with initial digit 1, so infinitely many terms with initial digit 1, every natural number will eventually appear, QED.

Examples

			a(1) = 1.
a(2) = 2 as it is the first multiple of 1 not yet in the sequence.
a(3) = 4 as it is the first multiple of 2 not yet in the sequence.
a(4) = 8 as it is the first multiple of 4 not yet in the sequence.
a(5) = 16 as it is the first multiple of 8 not yet in the sequence.
a(6) = 3 as it is the first multiple of 1 not yet in the sequence.
		

Crossrefs

See A248024 for a similar sequence.
Cf. A000030, A308541 (inverse).

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = Block[{k = 2}, While[Mod[k, First@IntegerDigits[a[n - 1]]] != 0 || MemberQ[Array[a, n - 1], k], k++]; k]; Array[a, 67] (* Giorgos Kalogeropoulos, May 12 2023 *)
  • PARI
    { s=0; v=1; u=1; for (n=1, 67, print1 (v ", "); s+=2^v; while (bittest(s,u), u++); forstep (w=ceil(u/d=digits(v)[1])*d, oo, d, if (!bittest(s,w), v=w; break))) }
    
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        an, aset, m = 1, {1}, 1
        while True:
            yield an
            an1 = int(str(an)[0])
            an = next(k for k in count(m) if k not in aset and k%an1 == 0)
            aset.add(an)
            while m in aset: m += 1
    print(list(islice(agen(), 67))) # Michael S. Branicky, Jan 27 2025

A257277 a(n+1) has a digit that divides a(n) and is the least positive integer not appearing earlier with this property.

Original entry on oeis.org

0, 1, 10, 2, 11, 12, 3, 13, 14, 7, 15, 5, 16, 4, 17, 18, 6, 19, 21, 23, 31, 41, 51, 30, 20, 22, 24, 8, 25, 35, 27, 9, 29, 61, 71, 81, 32, 26, 28, 34, 42, 33, 36, 37, 91, 47, 100, 40, 38, 52, 43, 101, 102, 39, 53, 103, 104, 44, 45, 49, 57, 63, 59, 105, 50, 54, 46, 62, 72, 48, 56, 58, 82, 92, 64, 68, 74, 106, 107, 108, 60, 55, 65, 75, 73, 109, 110, 85
Offset: 0

Views

Author

Eric Angelini and M. F. Hasler, May 07 2015

Keywords

Comments

A variant of A248024.
This is a permutation of the nonnegative integers, see A257276 for the inverse permutation.
There are large ranges of fixed points, e.g., between a(135) = 99 and a(200) = 201, or between a(1080) = 999 and a(2000) = 2001. For indices n in these ranges, the sequence restricted to [0...n] is a permutation (i.e., all numbers up to n appear among the values up to that point).
If one requires that a(n+1) has *no* digit dividing a(n), the sequence starts 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 30, 40, 33, 22, 34, ... and stops at a(1422) = 2520, divisible by any digit. If one requires the sequence to be increasing, then it goes ..., 20, 30, 40, 60, 70, 80, 90, 400, 600, 700, 800, 900, 7000, 9000, 70000, 90000, 700000, 900000, ...

Crossrefs

Programs

  • PARI
    {u=n=0;until(print1(n","),u+=1<!(n%i),vector(9,i,i));n=0;until(!bittest(u,n++)&&setintersect(d,Set(digits(n))),))}

A381081 Lexicographically earliest sequence of distinct positive integers such that the string value of a(n) begins with a divisor of a(n-1).

Original entry on oeis.org

1, 10, 2, 11, 12, 3, 13, 14, 7, 15, 5, 16, 4, 17, 18, 6, 19, 100, 20, 21, 30, 22, 23, 101, 102, 24, 8, 25, 50, 26, 27, 9, 31, 103, 104, 28, 29, 105, 32, 40, 41, 106, 53, 107, 108, 33, 34, 109, 110, 51, 35, 52, 42, 36, 37, 111, 38, 112, 43, 113, 114, 39, 115, 54, 60, 44, 45, 55, 56, 46, 116, 47, 117, 90, 57, 118, 59, 119, 70, 58, 120, 48, 49, 71, 121, 122
Offset: 1

Views

Author

Scott R. Shannon, Feb 13 2025

Keywords

Comments

The sequence contains many fixed points, these beginning 1, 22, 23, 40, 41, 52, 199, 1936, 1937, 1938, 1939, ... .

Examples

			a(2) = 10 as the only divisor of a(1) = 1 is 1, and 10 is the smallest unused number to begin with 1.
a(43) = 53 as a(42) = 106 whose divisors are 1, 2, 53, 106, and 53 is the smallest unused number to begin with 53 - all other smaller numbers beginning with 1 and 2 have been used. This is the first term to differ from A248024.
		

Crossrefs

Showing 1-5 of 5 results.