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

A001704 a(n) = n concatenated with n + 1.

Original entry on oeis.org

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

Keywords

Comments

See A030457 for the indices of prime terms in this sequence. - Reinhard Zumkeller, Jun 27 2015 [Simplified by Jianing Song, Jan 27 2019]

Crossrefs

See A127421 for a version with offset 0.

Programs

  • Haskell
    a001704 n = a001704_list !! (n-1)
    a001704_list = map read (zipWith (++) iss $ tail iss) :: [Integer]
                   where iss = map show [1..]
    -- Reinhard Zumkeller, Oct 07 2014
    
  • Magma
    [Seqint(Intseq(n+1) cat Intseq(n)): n in [1..50]]; // Vincenzo Librandi, Jul 08 2018
    
  • Maple
    f:=proc(i) i*10^(1+floor(evalf(log10(i+1), 10)))+i+1; end: # gives a(n) - N. J. A. Sloane, Aug 04 2012
    # alternative Maple program:
    a:= n-> parse(cat(n, n+1)):
    seq(a(n), n=1..55);  # Alois P. Heinz, Jul 05 2018
  • Mathematica
    Table[FromDigits@Flatten@IntegerDigits[{n, n + 1}], {n, 100}] (* T. D. Noe, Aug 09 2012 *)
  • PARI
    a(n)=eval(Str(n,n+1)) \\ Charles R Greathouse IV, Jul 23 2016
    (Emacs Lisp)
    ;; Concatenation
    (defun A001704 (n) (string-to-int (concat (int-to-string n) (int-to-string (1+ n)))))
    ;; Formula
    (defun A001704 (n) (1+ n (* n (expt 10 (1+ (floor (log (1+ n) 10)))))))
    (mapcar '(lambda (n) (cons n (A001704 n))) '(1 2 3 10 11 12 99 999)) => ((1 . 12) (2 . 23) (3 . 34) (10 . 1011) (11 . 1112) (12 . 1213) (99 . 99100) (999 . 9991000))
    ; Tim Chambers, Jul 07 2018
    
  • Python
    for n in range(1,100): print(str(n)+str(n+1)) # David F. Marrs, Sep 17 2018
    
  • Scala
    val numerStrs = (1 to 50).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 and Jon E. Schoenfield, May 15 2007

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

A127423 a(1) = 1; for n > 1, a(n) = n concatenated with n - 1.

Original entry on oeis.org

1, 21, 32, 43, 54, 65, 76, 87, 98, 109, 1110, 1211, 1312, 1413, 1514, 1615, 1716, 1817, 1918, 2019, 2120, 2221, 2322, 2423, 2524, 2625, 2726, 2827, 2928, 3029, 3130, 3231, 3332, 3433, 3534, 3635, 3736, 3837, 3938, 4039, 4140, 4241, 4342, 4443, 4544, 4645
Offset: 1

Views

Author

Artur Jasinski, Jan 14 2007

Keywords

Comments

a(1) could also have been defined to be 10. In that case the initial terms would be 10, 21, 32, 43, 54, 65, 76, 87, 98, 109, 1110, 1211, 1312, 1413, 1514, 1615, 1716, 1817, 1918, 2019, 2120, 2221, 2322, 2423, 2524, 2625, 2726, 2827, 2928, 3029, 3130, 3231, 3332, 3433, ... (Comment added in case someone is searching for that sequence.) - N. J. A. Sloane, Aug 11 2018
A010051(a(A054211(n))) = 1. - Reinhard Zumkeller, Jun 27 2015

Examples

			a(12) = 1211 because 12 and 11 are two consecutive decreasing numbers.
		

Crossrefs

Programs

  • Haskell
    a127423 n = a127423_list !! (n-1)
    a127423_list = 1 : map read (zipWith (++) (tail iss) iss) :: [Integer]
                       where iss = map show [1..]
    -- Reinhard Zumkeller, Oct 07 2014
    
  • Magma
    [Seqint(Intseq(n) cat Intseq(n+1)): n in [0..50]]; // Vincenzo Librandi, Nov 08 2016
    
  • Maple
    c2:=proc(x,y) local s: s:=proc(m) nops(convert(m,base,10)) end: x*10^s(y)+y: end: seq(c2(n,n-1),n=1..53); # Emeric Deutsch, Mar 07 2007
  • Mathematica
    Join[{1}, nxt[n_] := Module[{idn = IntegerDigits[n + 1], idn1 = IntegerDigits[n]}, FromDigits[Join[idn, idn1]]]; Array[nxt, 70]] (* Vincenzo Librandi, Nov 08 2016 *)
    nxt[{n_, a_}] := {n + 1, (n + 1) * 10^IntegerLength[n] + n}; NestList[nxt, {1, 1}, 50][[All, 2]] (* Harvey P. Dale, Jan 04 2019 *)
  • PARI
    a(n) = if (n==1, 1, eval(Str(n, n-1))); \\ Michel Marcus, Oct 14 2016
    
  • Scala
    val numerStrs = (1 to 50).map(Integer.toString(_)).toList
    val concats = (numerStrs.drop(1)) zip (numerStrs.dropRight(1))
    concats.map(x => Integer.parseInt(x.1 + x._2)) // _Alonso del Arte, Oct 24 2019

Extensions

More terms from Emeric Deutsch, Mar 07 2007

A074993 a(n) = floor((concatenation of n, n+1)/2).

Original entry on oeis.org

0, 6, 11, 17, 22, 28, 33, 39, 44, 455, 505, 556, 606, 657, 707, 758, 808, 859, 909, 960, 1010, 1061, 1111, 1162, 1212, 1263, 1313, 1364, 1414, 1465, 1515, 1566, 1616, 1667, 1717, 1768, 1818, 1869, 1919, 1970, 2020, 2071, 2121, 2172, 2222, 2273, 2323, 2374
Offset: 0

Views

Author

Amarnath Murthy, Aug 31 2002

Keywords

Comments

The first differences follow a pattern. Odd-indexed terms and even-indexed terms form separate A.P.s with the same common difference for all n except n = 10^k -1. The corresponding common differences are the repunits = (10^(d+1)-1)/9 where d = the number of digits in n.

Crossrefs

Programs

  • Mathematica
    cc[n_]:=Floor[FromDigits[Join[IntegerDigits[n],IntegerDigits[n+1]]]/2]; Array[cc,40,0] (* Harvey P. Dale, Nov 11 2011 *)

A279204 Numbers whose decimal expansion is a concatenation of 4 consecutive increasing nonnegative numbers.

Original entry on oeis.org

1234, 2345, 3456, 4567, 5678, 6789, 78910, 891011, 9101112, 10111213, 11121314, 12131415, 13141516, 14151617, 15161718, 16171819, 17181920, 18192021, 19202122, 20212223, 21222324, 22232425, 23242526, 24252627, 25262728, 26272829, 27282930, 28293031, 29303132, 30313233, 31323334
Offset: 1

Views

Author

N. J. A. Sloane, Dec 17 2016

Keywords

Comments

Primes in this sequence are A030471. Are there infinitely many primes in the sequence? - Chai Wah Wu, Dec 17 2016

Crossrefs

Cf. A030471 (primes).
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

  • Mathematica
    A279204[n_] := FromDigits[Flatten[IntegerDigits[Range[n, n + 3]]]];
    Array[A279204, 50] (* Paolo Xausa, Aug 26 2024 *)
  • Python
    def A279204(n):
        return int(str(n)+str(n+1)+str(n+2)+str(n+3)) # Chai Wah Wu, Dec 17 2016

A127424 Numbers whose decimal expansion is a concatenation of 3 consecutive decreasing numbers.

Original entry on oeis.org

210, 321, 432, 543, 654, 765, 876, 987, 1098, 11109, 121110, 131211, 141312, 151413, 161514, 171615, 181716, 191817, 201918, 212019, 222120, 232221, 242322, 252423, 262524, 272625, 282726, 292827, 302928, 313029, 323130, 333231, 343332, 353433, 363534
Offset: 1

Views

Author

Artur Jasinski, Jan 14 2007

Keywords

Examples

			a(13)=141312 because 14 and 13 and 12 are three consecutive decreasing numbers
		

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[Flatten[IntegerDigits[#]&/@Range[n,n-2,-1]]],{n,2,40}] (* Harvey P. Dale, Nov 28 2013 *)

Extensions

Corrected and extended by Harvey P. Dale, Nov 28 2013

A317744 Prime numbers which result as a concatenation of a decimal number and its binary representation.

Original entry on oeis.org

11, 311, 5101, 131101, 2511001, 37100101, 51110011, 59111011, 731001001, 931011101, 971100001, 1191110111, 12910000001, 13110000011, 13710001001, 15310011001, 17310101101, 19311000001, 21311010101, 21511010111, 24711110111, 25511111111, 319100111111
Offset: 1

Views

Author

Philip Mizzi, Aug 05 2018

Keywords

Comments

The decimal number plus its Hamming weight A000120 must not be divisible by 3. - M. F. Hasler, Apr 05 2024

Examples

			11 is in the sequence because the binary representation of 1 is 1 and the concatenation of 1 and 1 gives 11, which is prime.
931011101 is in the sequence because it is the concatenation of 93 and 1011101 (the binary representation of 93) and is prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Table[FromDigits[Join[IntegerDigits[n],IntegerDigits[n,2]]],{n,400}],PrimeQ] (* Harvey P. Dale, Jul 15 2020 *)
  • PARI
    nb(n)=fromdigits(concat(n,binary(n)))
    A317744_upto(N=666)=[p|n<-[1..N], is/*pseudo*/prime(p=nb(n))] \\ M. F. Hasler, Apr 05 2024
  • Python
    from sympy import isprime
    def nbinn(n): return int(str(n)+bin(n)[2:])
    def ok(n): return isprime(nbinn(n))
    def aprefixupto(p): return [nbinn(k) for k in range(1, p+1, 2) if ok(k)]
    print(aprefixupto(319)) # Michael S. Branicky, Dec 27 2020
    

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
Showing 1-9 of 9 results.