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

A001703 Decimal concatenation of n, n+1, and n+2.

Original entry on oeis.org

12, 123, 234, 345, 456, 567, 678, 789, 8910, 91011, 101112, 111213, 121314, 131415, 141516, 151617, 161718, 171819, 181920, 192021, 202122, 212223, 222324, 232425, 242526, 252627, 262728, 272829, 282930, 293031, 303132, 313233, 323334, 333435, 343536, 353637, 363738
Offset: 0

Views

Author

mag(AT)laurel.salles.entpe.fr

Keywords

Comments

All terms are divisible by 3. Every third term starting with a(2) is divisible by 9. - Alonso del Arte, May 27 2013

Examples

			a(8) = 8910 since the three consecutive numbers starting with 8 are 8, 9, 10, and these concatenate to 8910. (This is the first term that differs from A193431).
		

Crossrefs

Cf. A074991.
For concatenations of exactly k consecutive integers see A000027 (k=1), A127421 (k=2), A279204 (k=4). For 2 or more see A035333.
See also A127422, A127423, A127424.

Programs

  • Maple
    read(transforms) :
    A001703 := proc(n)
        digcatL([n,n+1,n+2]) ;
    end proc:
    seq(A001703(n),n=1..20) ; # R. J. Mathar, Mar 29 2017
    # Third Maple program:
    a:= n-> parse(cat(n, n+1, n+2)):
    seq(a(n), n=0..50); # Alois P. Heinz, Mar 29 2017
  • Mathematica
    concat3Nums[n_] := FromDigits@ Flatten@ IntegerDigits[{n, n + 1, n + 2}]; Array[concat3Nums, 25] (* Robert G. Wilson v *)
  • PARI
    a(n)=eval(Str(n,n+1,n+2)) \\ Charles R Greathouse IV, Oct 08 2011
    
  • Python
    for n in range(100): print(int(str(n)+str(n+1)+str(n+2))) # David F. Marrs, Sep 18 2018

Formula

The portion of the sequence with all three numbers having d digits - i.e., n in 10^(d-1)..10^d-3 - is in arithmetic sequence: a(n) = (10^(2*d)+10^d+1)*n + (10^d+2). - Franklin T. Adams-Watters, Oct 07 2011

Extensions

Initial term 12 added and offset changed to 0 at the suggestion of R. J. Mathar. - N. J. A. Sloane, Mar 29 2017

A035333 Concatenation of two or more consecutive positive integers.

Original entry on oeis.org

12, 23, 34, 45, 56, 67, 78, 89, 123, 234, 345, 456, 567, 678, 789, 910, 1011, 1112, 1213, 1234, 1314, 1415, 1516, 1617, 1718, 1819, 1920, 2021, 2122, 2223, 2324, 2345, 2425, 2526, 2627, 2728, 2829, 2930, 3031, 3132, 3233, 3334, 3435, 3456, 3536, 3637, 3738
Offset: 1

Views

Author

Keywords

Crossrefs

For concatenations of exactly k consecutive integers see A000027 (k=1), A127421 (k=2), A001703 (k=3), A279204 (k=4).
See also A007908 for concatenation of 1 through n.
For primes see A052087.
All of A007908, A052087, A053067, A279610 are subsequences.

Programs

  • Python
    import heapq
    from itertools import islice
    def agen():
        c = 12
        h = [(c, 1, 2)]
        nextcount = 3
        while True:
            (v, s, l) = heapq.heappop(h)
            yield v
            if v >= c:
                c = int(str(c) + str(nextcount))
                heapq.heappush(h, (c, 1, nextcount))
                nextcount += 1
            l += 1; v = int(str(v)[len(str(s)):] + str(l)); s += 1
            heapq.heappush(h, (v, s, l))
    print(list(islice(agen(), 47))) # Michael S. Branicky, Dec 23 2021

Extensions

Edited by Charles R Greathouse IV, Apr 28 2010
Corrected by Paul Tek, Jun 08 2013

A127421 Numbers whose decimal expansion is a concatenation of 2 consecutive increasing nonnegative numbers.

Original entry on oeis.org

1, 12, 23, 34, 45, 56, 67, 78, 89, 910, 1011, 1112, 1213, 1314, 1415, 1516, 1617, 1718, 1819, 1920, 2021, 2122, 2223, 2324, 2425, 2526, 2627, 2728, 2829, 2930, 3031, 3132, 3233, 3334, 3435, 3536, 3637, 3738, 3839, 3940, 4041, 4142, 4243, 4344, 4445, 4546
Offset: 1

Views

Author

Artur Jasinski, Jan 14 2007

Keywords

Comments

Primes in the sequence are in A030458. - Bruno Berselli, Mar 25 2015
a(n) always has an even number of digits unless n is in A103456. - Alonso del Arte, Oct 30 2019

Examples

			a(1) = "0,1" = 1.
a(13) = "12,13" = 1213.
		

Crossrefs

A variant of A001704.
For concatenations of exactly k consecutive integers see A000027 (k = 1), A127421 (k = 2), A001703 (k = 3), A279204 (k = 4). For 2 or more see A035333.

Programs

  • Magma
    [Seqint(Intseq(n+1) cat Intseq(n)): n in [0..50]]; // Bruno Berselli, Mar 25 2015
    
  • Maple
    a:= n-> parse(cat(n-1, n)):
    seq(a(n), n=1..55);  # Alois P. Heinz, Jul 05 2018
  • Mathematica
    nMax = 49; digitsList = IntegerDigits[Range[0, nMax]]; Table[FromDigits[Flatten[{digitsList[[n]], digitsList[[n + 1]]}]], {n, nMax - 1}] (* Alonso del Arte, Oct 24 2019 *)
    Table[FromDigits[Flatten[IntegerDigits/@{n,n+1}]],{n,0,50}] (* Harvey P. Dale, May 16 2020 *)
  • Python
    for n in range(100): print(int(str(n)+str(n+1))) # David F. Marrs, Sep 17 2018
    
  • Scala
    val numerStrs = (0 to 49).map(Integer.toString(_)).toList
    val concats = (numerStrs.dropRight(1)) zip (numerStrs.drop(1))
    concats.map(x => Integer.parseInt(x.1 + x._2)) // _Alonso del Arte, Oct 24 2019

Extensions

More terms from Joshua Zucker, May 15 2007

A030471 Primes which are concatenations of four consecutive numbers.

Original entry on oeis.org

4567, 14151617, 20212223, 34353637, 58596061, 64656667, 118119120121, 140141142143, 148149150151, 176177178179, 196197198199, 218219220221, 220221222223, 236237238239, 238239240241, 268269270271, 278279280281
Offset: 1

Views

Author

Keywords

Comments

There are no primes which are concatenations of three consecutive numbers (A001703), in fact all such concatenations are divisible by 3. - Zak Seidov, Oct 25 2014

Crossrefs

Programs

  • Mathematica
    A279204[n_] := FromDigits[Flatten[IntegerDigits[Range[n, n + 3]]]];
    Select[Array[A279204, 500], PrimeQ] (* Paolo Xausa, Aug 26 2024 *)
  • PARI
    lista(nn) = for(n=1, nn, if (isprime(q=eval(concat(concat(concat(Str(n), Str(n+1)), Str(n+2)), Str(n+3)))), print1(q, ", "))); \\ Michel Marcus, Oct 26 2014
    
  • Python
    from sympy import isprime
    from itertools import count, islice
    def agen(): # generator of terms
        strs = ["1", "2", "3", "4"]
        for k in count(1):
            if isprime(t:=int("".join(strs))): yield t
            strs = strs[1:] + [str(k+4)]
    print(list(islice(agen(), 20))) # Michael S. Branicky, Aug 26 2024

Extensions

Edited by Charles R Greathouse IV, Apr 23 2010

A287747 Concatenation {n, n + 1,.., n + 9}.

Original entry on oeis.org

12345678910, 234567891011, 3456789101112, 45678910111213, 567891011121314, 6789101112131415, 78910111213141516, 891011121314151617, 9101112131415161718, 10111213141516171819, 11121314151617181920, 12131415161718192021, 13141516171819202122, 14151617181920212223
Offset: 1

Views

Author

XU Pingya, Jun 01 2017

Keywords

Comments

For the position of primes in this sequence, see A287244.

Crossrefs

Programs

  • Mathematica
    A287747[n_] := FromDigits[Flatten[IntegerDigits[Range[n, n + 9]]]];
    Array[A287747, 25] (* Paolo Xausa, Aug 26 2024 *)

A375481 Starting numbers for the terms in A035333.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 1, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 2, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 3, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 4, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 5, 57, 58
Offset: 1

Views

Author

Nicholas M. R. Frieler, Aug 17 2024

Keywords

Examples

			a(19) = 12 since A035333(19) = 1213, the concatenation of 12 and 13.
a(20) =  1 since A035333(20) = 1234, the concatenation of 1, 2, 3 and 4.
		

Crossrefs

For the terms generated by consecutive concatenations see A035333.For concatenations of various numbers of consecutive integers see A000027 (k=1), A127421 (k=2), A001703 (k=3), A279204 (k=4).For primes that are the concatenation of two or more consecutive integers see A052087.

Programs

  • Mathematica
    ConsecutiveNumber[num_, numberOfNumbers_] := Module[{},
      If[numberOfNumbers == 1, Return[num]];
      FromDigits@(IntegerDigits[num]~Join~
         IntegerDigits@ConsecutiveNumber[num + 1, numberOfNumbers - 1])
     ]
    ConsecutiveNumberDigits[maxDigits_] := Module[{numList = {}, c, d},
      Do[
       numList =
         numList~Join~(Association[# -> ConsecutiveNumber[#, c]] & /@
            Range[Power[10, d - 1], Power[10, d] - 1]);,
       {d, 1, Floor[maxDigits/2]}, {c, 2, Floor[maxDigits/d]}
       ];
      SortBy[Select[numList, Values[#][[1]] < Power[10, maxDigits] &],
       Values[#] &]
     ]
    Keys[ConsecutiveNumberDigits[8]]//Flatten (* number in this line corresponds to the maximum number of digits of the concatenated terms *)
  • Python
    import heapq
    from itertools import islice
    def agen(): # generator of terms
        c = 12
        h = [(c, 1, 2)]
        nextcount = 3
        while True:
            (v, s, l) = heapq.heappop(h)
            yield s
            if v >= c:
                c = int(str(c) + str(nextcount))
                heapq.heappush(h, (c, 1, nextcount))
                nextcount += 1
            l += 1; v = int(str(v)[len(str(s)):] + str(l)); s += 1
            heapq.heappush(h, (v, s, l))
    print(list(islice(agen(), 70))) # Michael S. Branicky, Aug 18 2024

A375692 Decimal concatenation of the 5 numbers n,n+1,n+2,n+3,n+4.

Original entry on oeis.org

12345, 23456, 34567, 45678, 56789, 678910, 7891011, 89101112, 910111213, 1011121314, 1112131415, 1213141516, 1314151617, 1415161718, 1516171819, 1617181920, 1718192021, 1819202122, 1920212223, 2021222324, 2122232425, 2223242526, 2324252627, 2425262728, 2526272829
Offset: 1

Views

Author

Viljo Huhtala, Aug 25 2024

Keywords

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[Join[Flatten[IntegerDigits/@{n,n+1,n+2,n+3,n+4}]]],{n,25}] (* James C. McMahon, Oct 11 2024 *)
  • PARI
    a(n) = eval(concat(vector(5, i, Str(n+i-1)))); \\ Michel Marcus, Sep 17 2024
  • Python
    def a(n): return int(str(n)+str(n+1)+str(n+2)+str(n+3)+str(n+4))
    
Showing 1-7 of 7 results.