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-10 of 14 results. Next

A367578 a(0) = 0, a(1) = 1; for n > 1, a(n) = a(n-1) - CT(a(n-2),a(n-1)) if nonnegative and not already in the sequence, else a(n) = a(n-1) + CT(a(n-2),a(n-1)), where CT(a,b) is the Comma transform (cf. A367360) of a and b.

Original entry on oeis.org

0, 1, 2, 14, 35, 78, 21, 103, 92, 53, 28, 60, 146, 145, 84, 26, 68, 134, 215, 173, 122, 91, 62, 46, 22, 84, 56, 11, 72, 55, 30, 83, 75, 38, 91, 180, 169, 168, 77, 164, 93, 44, 10, 51, 56, 41, 105, 94, 153, 112, 81, 109, 98, 197, 116, 45, 109, 58, 153, 234, 202, 160, 139, 138, 47, 131, 202, 190
Offset: 0

Views

Author

Scott R. Shannon, Nov 25 2023

Keywords

Comments

This is a variation of Recamán's sequence A005132, where the step size is calculated from the Comma transform of the previous two terms, see A367360 and A121805. As the maximum step size is 99, it is likely that many numbers never appear. In the first 10 million terms the smallest numbers that do appear are 0,1,2,8,10,11,14,17,21,22. The first number to appear twice is 84. The terms show a broadly repetitive pattern that repeats every order of magnitude, although slight differences are still present; see the two attached images.

Examples

			a(2) = 2 as CT(a(0),a(1)) = CT(0,1) = 1, so a(2) = a(1) + 1 = 2.
a(3) = 14 as CT(a(1),a(2)) = CT(1,2) = 12, so a(3) = a(2) + 12 = 14.
a(7) = 21 as CT(a(5),a(6)) = CT(35,78) = 57, so a(7) = a(6) - 57 = 21, as 21 is nonnegative and not already in the sequence.
		

Crossrefs

A367646 a(0) = 0, a(1) = 1; for n > 1, a(n) = a(n-1) - GCT(a(n-2),a(n-1)) if nonnegative and not already in the sequence, else a(n) = a(n-1) + CT(a(n-2),a(n-1)), where CT(a,b) is the Comma transform (cf. A367360) of a and b, while GCT(a,b) is the largest possible generalized Command transform (cf. A367635) where at least one digit of both a and b can be chosen.

Original entry on oeis.org

0, 1, 2, 14, 35, 78, 21, 103, 92, 53, 28, 60, 146, 132, 71, 44, 30, 73, 66, 102, 41, 17, 6, 82, 150, 129, 117, 26, 98, 29, 111, 20, 8, 16, 97, 166, 95, 164, 113, 72, 109, 88, 186, 105, 166, 115, 54, 109, 68, 164, 83, 131, 100, 89, 81, 179, 62, 158, 137, 56, 131, 70, 87, 79, 156, 65, 131, 80
Offset: 0

Views

Author

Scott R. Shannon, Nov 25 2023

Keywords

Comments

This is a variation of A367578, where one can choose more than one digit from both a(n-2) and a(n-1) to create the largest possible step to a nonnegative number which has not previously appeared to form a(n). If all such numbers have already appeared the smallest possible forward step is chosen, which is just the standard Comma transform of a(n-2) and a(n-1).
It is conjectured that all nonnegative numbers appear in the sequence. After the first 10 million terms the only fixed points are 0, 1, 2, 29, 65, 84, 222, 377, 491, 499, and it is likely no more exist. The first number to appear twice is a(35) = a(44) = 166.

Examples

			a(3) = 14 as CT(a(1),a(2)) = CT(1,2) = 12, so a(3) = a(2) + 12 = 14.
a(6) = 21 as GCT(a(4),a(5)) = GCT(35,78) = 57, so a(6) = a(5) - 57 = 21, as 21 is nonnegative and not already in the sequence.
a(13) = 132 as GCT(a(11),a(12)) = GCT(60,146) = 14, so a(13) = a(12) - 14 = 132, as 132 is nonnegative and not already in the sequence. This is the first term to differ from A367578.
		

Crossrefs

A369303 a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest unused number whose string value contains the comma transform (cf. A367360) of the previous two terms.

Original entry on oeis.org

1, 2, 12, 21, 22, 112, 121, 210, 120, 10, 11, 13, 110, 31, 3, 113, 131, 231, 122, 111, 211, 123, 114, 310, 43, 4, 34, 143, 41, 134, 115, 141, 51, 15, 116, 151, 61, 16, 117, 161, 71, 17, 118, 171, 81, 18, 119, 181, 91, 19, 311, 93, 190, 312, 23, 220, 32, 30, 223, 20, 132, 14, 212, 42, 24, 221
Offset: 1

Views

Author

Scott R. Shannon, Jan 19 2024

Keywords

Comments

The sequence is conjectured to be a permutation of the positive integers. The fixed points begin 1, 2, 10, 11, 2863, 3164, 3545, 3947, 6835, 6947, 7052, ... although it is likely there are infinitely more.

Examples

			a(3) = 12 as the comma transform of 1 and 2 is 12.
a(6) = 112 as the comma transform of 21 and 22 is 12, but 12 has already appeared so the next lowest unused number to contain '12' is 112.
		

Crossrefs

A121805 The "comma sequence": the lexicographically earliest sequence of positive numbers with the property that the sequence formed by the pairs of digits adjacent to the commas between the terms is the same as the sequence of successive differences between the terms.

Original entry on oeis.org

1, 12, 35, 94, 135, 186, 248, 331, 344, 387, 461, 475, 530, 535, 590, 595, 651, 667, 744, 791, 809, 908, 997, 1068, 1149, 1240, 1241, 1252, 1273, 1304, 1345, 1396, 1457, 1528, 1609, 1700, 1701, 1712, 1733, 1764, 1805, 1856, 1917, 1988, 2070
Offset: 1

Views

Author

Eric Angelini, Dec 11 2006

Keywords

Comments

An equivalent, but more formal definition, is: a(1) = 1; for n > 1, let x be the least significant digit of a(n-1); then a(n) = a(n-1) + x*10 + y where y is the most significant digit of a(n) and is the smallest such y, if such a y exists. If no such y exists, stop.
The sequence contains exactly 2137453 terms, with a(2137453)=99999945. The next term does not exist. - W. Edwin Clark, Dec 11 2006
It is remarkable that the sequence persists for so long. - N. J. A. Sloane, Dec 15 2006
The similar sequence A139284, which starts at a(1)=2, persists even longer, ending at a(194697747222394) = 9999999999999918. - Giovanni Resta, Nov 30 2019
Conjecture: This sequence is finite, for any initial term. - N. J. A. Sloane, Nov 14 2023
The base 2 analog (suggested by William Cheswick) is 1, 4, 5, 8, 9, 12, 13, ..., (see A042948) with successive differences 3, 1, 3, 1, ... (repeat). - N. J. A. Sloane, Nov 15 2023
Does not satisfy Benford's Law. - Michael S. Branicky, Nov 16 2023
Using the notion of "comma transform" of a sequence, as defined in A367360, this is the lexicographically earliest sequence of positive integers with the property that its first differences and comma transform coincide. - N. J. A. Sloane, Nov 23 2023

Examples

			Replace each comma in the original sequence by the pair of digits adjacent to the comma; the result is the sequence of first differences between the terms of the sequence:
Sequence:   1, 12, 35, 94, 135, 186, 248, 331, 344, 387, 461, 475, ...
Differences: 11, 23, 59, 41 , 51 , 62 , 83 , 13 , 43 , 74 , 14 , ...
To illustrate the formula in the comment: a(6) = 186 and a(7) = 248 = 186 + 62.
		

References

  • Eric Angelini, "Jeux de suites", in Dossier Pour La Science, pp. 32-35, Volume 59 (Jeux math'), April/June 2008, Paris.

Crossrefs

See A366487 and A367349 for first differences.
Comma sequences in base 10, starting with 1, 2, 4, 5, 6, 7, 8, 9, 10 are A121805, A139284, A366492, A367337, A367350, A367351, A367352, A367353, A367354. Starting with 3 is trivial, and those starting with 11, 12, 13 are essentially duplicates.
Cf. A330128, A330129, A367338 (comma-successor), A367360.
See also A260261, A042948.

Programs

  • Maple
    digits:=n->ListTools:-Reverse(convert(n,base,10)):
    nextK:=proc(K) local i,L; for i from 0 to 9 do L:=K+digits(K)[ -1]*10+i; if i = digits(L)[1] then return L; fi; od; FAIL; end:
    A121805:=proc(n) option remember: if n = 1 then return 1; fi; return nextK(A121805(n-1)); end: # W. Edwin Clark
  • Mathematica
    a[1] = 1; a[n_] := a[n] = For[x=Mod[a[n-1], 10]; y=0, y <= 9, y++, an = a[n-1] + 10*x + y; If[y == IntegerDigits[an][[1]], Return[an]]]; Array[a, 45] (* Jean-François Alcover, Nov 25 2014 *)
  • PARI
    a=1; for(n=1,1000, print1(a", "); a+=a%10*10; for(k=1, 9, digits(a+k)[1]==k&&(a+=k)&&next(2)); error("blocked at a("n")=",a-a%10*10)) \\ M. F. Hasler, Jul 21 2015
    
  • Python
    from itertools import islice
    def agen(): # generator of terms
        an, y = 1, 1
        while y < 10:
            yield an
            an, y = an + 10*(an%10), 1
            while y < 10:
                if str(an+y)[0] == str(y):
                    an += y
                    break
                y += 1
    print(list(islice(agen(), 45))) # Michael S. Branicky, Apr 08 2022
  • R
    A121805 <- data.frame(n=seq(from=1,to=2137453),a=integer(2137453)); A121805$a[1]=1; for (i in seq(from=2,to=2137453)){LSD=A121805$a[i-1] %% 10; k = 1; while (k != as.integer(substring(A121805$a[i-1]+LSD*10+k,1,1))){k = k+1; if(k>9) break} A121805$a[i]=A121805$a[i-1]+LSD*10+k} # Simon Demers, Oct 19 2017
    

Extensions

More terms from Zak Seidov, Dec 11 2006
Edited by N. J. A. Sloane, Sep 17 2023
Changed name from "commas sequence" to "comma sequence". - N. J. A. Sloane, Dec 20 2023

A166499 Concatenation of the rightmost digit of the n-th prime and the leftmost digit of the (n+1)th prime.

Original entry on oeis.org

23, 35, 57, 71, 11, 31, 71, 92, 32, 93, 13, 74, 14, 34, 75, 35, 96, 16, 77, 17, 37, 98, 38, 99, 71, 11, 31, 71, 91, 31, 71, 11, 71, 91, 91, 11, 71, 31, 71, 31, 91, 11, 11, 31, 71, 92, 12, 32, 72, 92, 32, 92, 12, 12, 72, 32, 92, 12, 72, 12, 32, 33, 73, 13, 33, 73, 13, 73, 73
Offset: 1

Views

Author

Zak Seidov, Oct 15 2009

Keywords

Comments

This is the comma transform of the primes (see A367360).

Crossrefs

Programs

  • Maple
    a:= n-> parse(cat(""||(ithprime(n))[-1],""||(ithprime(n+1))[1])):
    seq(a(n), n=1..99);  # Alois P. Heinz, Nov 22 2023
  • Mathematica
    With[{nmax=100},Map[10Mod[#[[1]],10]+IntegerDigits[#[[2]]][[1]]&,Partition[Prime[Range[nmax+1]],2,1]]] (* Paolo Xausa, Nov 24 2023 *)

Formula

a(n) = 10 * A007652(n) + A077648(n+1). - Alois P. Heinz, Nov 23 2023

A367362 Comma transform of the nonnegative integers.

Original entry on oeis.org

1, 12, 23, 34, 45, 56, 67, 78, 89, 91, 1, 11, 21, 31, 41, 51, 61, 71, 81, 92, 2, 12, 22, 32, 42, 52, 62, 72, 82, 93, 3, 13, 23, 33, 43, 53, 63, 73, 83, 94, 4, 14, 24, 34, 44, 54, 64, 74, 84, 95, 5, 15, 25, 35, 45, 55, 65, 75, 85, 96, 6, 16, 26, 36, 46, 56, 66, 76, 86, 97, 7, 17, 27, 37, 47, 57, 67, 77, 87, 98, 8, 18
Offset: 0

Views

Author

N. J. A. Sloane, Nov 22 2023

Keywords

Comments

See A367360 for further information.

Crossrefs

Programs

  • Maple
    a:= n-> parse(cat(""||n[-1], ""||(n+1)[1])):
    seq(a(n), n=0..99);  # Alois P. Heinz, Nov 22 2023
  • Mathematica
    FromDigits /@ Partition[Rest@ Flatten[{First[#], Last[#]} & /@ IntegerDigits[Range[0, 120]]], 2, 2] (* Michael De Vlieger, Nov 22 2023 *)
  • Python
    from itertools import count, islice, pairwise
    def S(): yield from (str(i) for i in count(0))
    def agen(): yield from (int(t[-1]+u[0]) for t, u in pairwise(S()))
    print(list(islice(agen(), 82))) # Michael S. Branicky, Nov 22 2023
    
  • Python
    def A367362(n): return (n%10)*10+int(str(n+1)[0]) # Chai Wah Wu, Dec 22 2023

Formula

a(n) = 10 * A010879(n) + A000030(n+1). - Alois P. Heinz, Nov 22 2023

A367361 Comma transform of powers of 2.

Original entry on oeis.org

12, 24, 48, 81, 63, 26, 41, 82, 65, 21, 42, 84, 68, 21, 43, 86, 61, 22, 45, 81, 62, 24, 48, 81, 63, 26, 41, 82, 65, 21, 42, 84, 68, 21, 43, 86, 61, 22, 45, 81, 62, 24, 48, 81, 63, 27, 41, 82, 65, 21, 42, 84, 69, 21, 43, 87, 61, 22, 45, 81, 62, 24, 49, 81, 63, 27, 41, 82, 65, 21, 42, 84, 69, 21, 43, 87, 61, 23, 46, 81
Offset: 0

Views

Author

N. J. A. Sloane, Nov 22 2023

Keywords

Comments

See A367360 for further information.

Crossrefs

Programs

  • Mathematica
    FromDigits /@ Partition[Rest@ Flatten[{First[#], Last[#]} & /@ IntegerDigits[2^Range[0, 120]]], 2, 2] (* Michael De Vlieger, Nov 22 2023 *)
  • Python
    from itertools import count, islice, pairwise
    def S(): yield from (str(2**i) for i in count(0))
    def agen(): yield from (int(t[-1]+u[0]) for t, u in pairwise(S()))
    print(list(islice(agen(), 80))) # Michael S. Branicky, Nov 22 2023
    
  • Python
    def A367361(n): return (60,20,40,80)[n&3]+int(str(1<Chai Wah Wu, Dec 22 2023

Formula

a(n) = 10 * A000689(n) + A008952(n+1). - Alois P. Heinz, Nov 22 2023

A368362 Inverse comma transform of 1,2,3,4,5,...,99.

Original entry on oeis.org

10, 10, 20, 30, 40, 50, 60, 70, 80, 91, 1, 11, 21, 31, 41, 51, 61, 71, 81, 92, 2, 12, 22, 32, 42, 52, 62, 72, 82, 93, 3, 13, 23, 33, 43, 53, 63, 73, 83, 94, 4, 14, 24, 34, 44, 54, 64, 74, 84, 95, 5, 15, 25, 35, 45, 55, 65, 75, 85, 96, 6, 16, 26, 36, 46, 56, 66, 76, 86, 97, 7, 17, 27, 37, 47, 57, 67, 77, 87, 98, 8, 18, 28, 38, 48, 58, 68, 78, 88, 99, 9, 19, 29, 39, 49, 59, 69, 79, 89
Offset: 1

Views

Author

N. J. A. Sloane, Jan 03 2024

Keywords

Comments

See A367360 for further information.

Crossrefs

A367556 Comma transform of the Fibonacci numbers.

Original entry on oeis.org

1, 11, 12, 23, 35, 58, 81, 32, 13, 45, 58, 91, 42, 33, 76, 9, 71, 72, 44, 16, 51, 61, 12, 74, 87, 51, 31, 83, 15, 98, 1, 92, 93, 85, 79, 51, 22, 73, 96, 61, 51, 12, 64, 77, 31, 1, 32, 34, 67, 91, 52, 43, 95, 38, 21, 52, 73, 25, 99, 11, 2, 14, 16, 21, 31, 52, 84
Offset: 0

Views

Author

Alois P. Heinz, Nov 22 2023

Keywords

Comments

See A367360 for further information.

Crossrefs

Programs

  • Maple
    F:= combinat[fibonacci]:
    a:= n-> parse(cat(""||(F(n))[-1], ""||(F(n+1))[1])):
    seq(a(n), n=0..92);
  • Mathematica
    With[{nmax=100},Map[10Mod[#[[1]],10]+IntegerDigits[#[[2]]][[1]]&,Partition[Fibonacci[Range[0,nmax+1]],2,1]]] (* Paolo Xausa, Nov 24 2023 *)
  • Python
    from sympy import fibonacci
    from itertools import islice, pairwise, count
    def S(): yield from (fibonacci(i) for i in count(0))
    def C(g): # generator of comma transform of sequence passed as a generator
        yield from (10*(t%10) + int(str(u)[0]) for t, u in pairwise(g))
    def agen(): return C(S())
    print(list(islice(agen(), 67))) # Michael S. Branicky, Jan 05 2024

Formula

a(n) = 10 * A003893(n) + A008963(n+1).

A367610 Comma transform of A367362.

Original entry on oeis.org

11, 22, 33, 44, 55, 66, 77, 88, 99, 11, 11, 12, 13, 14, 15, 16, 17, 18, 19, 22, 21, 22, 23, 24, 25, 26, 27, 28, 29, 33, 31, 32, 33, 34, 35, 36, 37, 38, 39, 44, 41, 42, 43, 44, 45, 46, 47, 48, 49, 55, 51, 52, 53, 54, 55, 56, 57, 58, 59, 66, 61, 62, 63, 64, 65, 66, 67, 68, 69, 77, 71, 72, 73, 74, 75, 76, 77, 78, 79
Offset: 1

Views

Author

N. J. A. Sloane, Dec 11 2023

Keywords

Comments

This is the second-order comma transform of the nonnegative integers.
See A367360 for further information.

Crossrefs

Programs

  • Python
    from itertools import count, islice, pairwise
    def S(): yield from (str(i) for i in count(0))
    def C(): yield from (str(int(t[-1]+u[0])) for t, u in pairwise(S()))
    def a(): yield from (int(t[-1]+u[0]) for t, u in pairwise(C()))
    print(list(islice(a(), 80))) # Michael S. Branicky, Dec 11 2023
Showing 1-10 of 14 results. Next