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

A000422 Concatenation of numbers from n down to 1.

Original entry on oeis.org

1, 21, 321, 4321, 54321, 654321, 7654321, 87654321, 987654321, 10987654321, 1110987654321, 121110987654321, 13121110987654321, 1413121110987654321, 151413121110987654321, 16151413121110987654321, 1716151413121110987654321, 181716151413121110987654321
Offset: 1

Views

Author

R. Muller

Keywords

Comments

The first prime term in this sequence is a(82) (see A176024). - Artur Jasinski, Mar 30 2008
For n < 10^4, a(n)/A000217(n) is an integer for n = 1, 2, and 18. The integers are 1, 7 (prime), and 1062667552123515268933651, respectively. - Derek Orr, Sep 04 2014

References

  • F. Smarandache, "Properties of the Numbers", University of Craiova Archives, 1975; Arizona State University Special Collections, Tempe, AZ

Crossrefs

Programs

  • Maple
    a[1]:= 1:
    for n from 2 to 100 do
    a[n]:= n*10^(1+ilog10(a[n-1])) + a[n-1]
    od:
    seq(a[n],n=1..100); # Robert Israel, Sep 05 2014
    # second Maple program:
    a:= proc(n) a(n):= `if`(n=1, 1, parse(cat(n, a(n-1)))) end:
    seq(a(n), n=1..22);  # Alois P. Heinz, Jan 12 2021
  • Mathematica
    b = {}; a = {}; Do[w = RealDigits[n]; w = First[w]; Do[PrependTo[a, w[[Length[w] - k + 1]]], {k, 1, Length[w]}]; p = FromDigits[a]; AppendTo[b, p], {n, 1, 30}]; b (* Artur Jasinski, Mar 30 2008 *)
    Table[FromDigits[Flatten[IntegerDigits/@Range[n,1,-1]]],{n,20}] (* Harvey P. Dale, Jul 06 2019 *)
  • PARI
    a(n)=my(t=n);forstep(k=n-1,1,-1,t=t*10^#Str(k)+k);t \\ Charles R Greathouse IV, Jul 15 2011
    
  • PARI
    A000422(n,p=1,L=1)=sum(k=1,n,k*p*=L+(k==L&&!L*=10)) \\ M. F. Hasler, Nov 02 2016
    
  • Python
    def a(n): return int("".join(map(str, range(n, 0, -1))))
    print([a(n) for n in range(1, 19)]) # Michael S. Branicky, Dec 08 2021

Formula

a(n+1) = (n+1)*10^len(a(n)) + a(n), where len(k) = number of digits in k.
a(n) = Sum_{k=1..n} k*10^(A058183(k) - (1+floor(log10(k)))). - Alexander Goebel, Mar 07 2020
From Serge Batalov, Dec 08 2021: (Start)
a(n) = ((n*9-1)*10^n+1)/9^2 for n < 10,
a(n) = ((n*99-1)*10^(2*n-19)-89)/99^2*10^10 + (8*10^10+1)/9^2 for 10 <= n < 100,
a(n) = ((n*999-1)*10^(3*n-299)-989)/999^2*10^191 + c2 for 10^2 <= n < 10^3,
a(n) = ((n*9999-1)*10^(4*n-3999)-9989)/9999^2*10^2892 + c3 for 10^3 <= n < 10^4,
a(n) = ((n*99999-1)*10^(5*n-49999)-99989)/99999^2*10^38893 + c4 for 10^4 <= n < 10^5,
a(n) = ((n*999999-1)*10^(6*n-599999)-999989)/999999^2*10^488894 + c5 for 10^5 <= n < 10^6,
where
c2 = (98*10^191 + 879*10^10 + 121)/99^2 = a(99),
c3 = (998*10^2701 - 989)/999^2*10^191 + c2 = a(999),
c4 = (9998*10^36001 - 9989)/9999^2*10^2892 + c3 = a(9999),
c5 = (99998*10^450001 - 99989)/99999^2*10^38893 + c4 = a(99999).
(End)

Extensions

Edited by N. J. A. Sloane, Dec 03 2021

A110757 a(n) = number of divisors of N, where N = reverse concatenation of 1,2,3,...,n.

Original entry on oeis.org

1, 4, 4, 4, 8, 4, 4, 12, 18, 8, 4, 8, 8, 16, 48, 16, 96, 576, 16, 32, 16, 32, 16, 32, 64, 256, 96, 32, 128, 256, 8, 64, 32, 128, 384, 144, 16, 8, 64, 32, 256, 64, 8, 192, 96, 32, 128, 128, 8, 64, 8, 128, 1280, 2560, 8, 24, 16, 64, 8, 8, 32, 384, 48, 64, 128, 128
Offset: 1

Views

Author

Amarnath Murthy, Aug 11 2005

Keywords

Examples

			a(3) = tau(321) = 4.
		

Crossrefs

Programs

  • Mathematica
    s = ""; Do[s = ToString[n] <> s; Print[DivisorSigma[0, ToExpression[s]]], {n, 1, 45}] (* Ryan Propper, Sep 23 2005 *)
    Table[DivisorSigma[0,FromDigits[Flatten[IntegerDigits/@Range[n,1,-1]]]],{n,50}] (* The program takes a long time to run. *) (* Harvey P. Dale, Jun 06 2018 *)

Formula

a(n) = A000005(A000422(n)). - Jinyuan Wang, May 23 2020

Extensions

More terms from Ryan Propper, Sep 23 2005
a(46)-a(66) from Jinyuan Wang, May 23 2020

A348792 Numbers k such that the reverse concatenation of the first k binary numbers A098780(k) is prime.

Original entry on oeis.org

2, 3, 4, 7, 11, 13, 25, 97, 110, 1939
Offset: 1

Views

Author

N. J. A. Sloane, Dec 03 2021

Keywords

Examples

			a(4) = 7 is because the binary number 111 110 101 100 11 10 1 (with no spaces), which is 128413 in decimal, is prime.
		

Crossrefs

Programs

  • Maple
    q:= n-> isprime(Bits[Join](['Bits[Split](i)[]'$i=1..n])):
    select(q, [$1..200])[];  # Alois P. Heinz, Dec 03 2021
  • Mathematica
    f[n_] := FromDigits[Flatten @ IntegerDigits[Range[n, 1, -1], 2], 2]; Select[Range[120], PrimeQ[f[#]] &] (* Amiram Eldar, Dec 03 2021 *)
  • Python
    from sympy import isprime
    def afind(limit):
        s, k = "", 1
        for k in range(1, limit+1):
            s += bin(k)[2:][::-1]
            t = int(s[::-1], 2)
            if isprime(t):
                print(k, end=", ")
    afind(200) # Michael S. Branicky, Dec 03 2021

Extensions

a(8)-a(10) from Amiram Eldar, Dec 03 2021

A283514 Concatenation of the numbers from n down to 3.

Original entry on oeis.org

3, 43, 543, 6543, 76543, 876543, 9876543, 109876543, 11109876543, 1211109876543, 131211109876543, 14131211109876543, 1514131211109876543, 161514131211109876543, 17161514131211109876543, 1817161514131211109876543, 191817161514131211109876543
Offset: 3

Views

Author

XU Pingya, Apr 14 2017

Keywords

Comments

The a(3) = 3, a(4) = 43, a(7) = 76543, a(46) = 464544...876543 are primes in this sequence (for n < 2823).

Crossrefs

Showing 1-4 of 4 results.