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.

Previous Showing 31-40 of 72 results. Next

A077183 Smallest number k such that the reverse concatenation of natural numbers from k to 1 is divisible by prime(n), or 0 if no such number exists.

Original entry on oeis.org

0, 2, 0, 2, 14, 15, 9, 5, 16, 4, 25, 21, 40, 67, 78, 66, 25, 111, 161, 49, 30, 15, 27, 20, 63, 98, 102, 3, 99, 92, 296, 71, 22, 367, 4, 48, 50, 91, 45, 241, 137, 258, 23, 28, 212, 40, 96, 408, 456, 110, 16, 731, 403, 667, 90, 130, 111, 458, 146, 18, 577, 276, 708
Offset: 1

Views

Author

Amarnath Murthy, Nov 01 2002

Keywords

Comments

Conjecture: a(n) > 0 for all n > 3, since prime(1) = 2 and prime(3) = 5 are the only primes whose multiples cannot end in 1. - Ryan Propper, Jul 29 2005

Examples

			a(4) = 2 as 21 is divisible by prime(4) = 7.
The smallest reverse concatenation of natural numbers k..1 that is divisible by prime(5) = 11 is 1413121110987654321, so a(5) = k = 14.
		

Crossrefs

Programs

  • Mathematica
    Do[p = Prime[n]; k = 1; s = ToString[k]; While[Mod[ToExpression[s], p] > 0, k++; s = ToString[k] <> s]; Print[k], {n, 4, 50}] (* Ryan Propper, Jul 29 2005 *)

Extensions

Corrected and extended by Ralf Stephan, Mar 18 2003
Example clarified by Harvey P. Dale, Aug 22 2013

A138957 Concatenation of the reversed digits of numbers from 1 to n.

Original entry on oeis.org

1, 12, 123, 1234, 12345, 123456, 1234567, 12345678, 123456789, 12345678901, 1234567890111, 123456789011121, 12345678901112131, 1234567890111213141, 123456789011121314151, 12345678901112131415161
Offset: 1

Views

Author

Artur Jasinski, Apr 04 2008, Apr 05 2008

Keywords

Comments

There are no primes in this sequence for n<=7000

Crossrefs

Programs

  • Mathematica
    b = {}; a = {}; Do[w = RealDigits[n]; w = First[w]; Do[AppendTo[a, w[[Length[w] - k + 1]]], {k, 1, Length[w]}]; p = FromDigits[a]; AppendTo[b, p], {n, 1, 21}]; b
    (* or *)
    Table[FromDigits[Flatten[Reverse/@IntegerDigits[Range[n]]]],{n,20}] (* Harvey P. Dale, Oct 22 2013 *)

A138960 a(n) = smallest prime divisor of A138957(n).

Original entry on oeis.org

1, 2, 3, 2, 3, 2, 127, 2, 3, 857, 3, 3, 18503, 3, 3, 43, 3, 3, 17, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 7, 3, 3, 1051, 3, 3, 67103, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 5, 3, 3, 5, 3, 3, 5, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 1

Views

Author

Artur Jasinski, Apr 04 2008

Keywords

Comments

For largest prime divisors see A138961.

Crossrefs

Programs

  • Mathematica
    a = {}; b = {}; Do[w = RealDigits[n]; w = First[w]; Do[AppendTo[a, w[[Length[w] - k + 1]]], {k, 1, Length[w]}]; p = FromDigits[a]; AppendTo[b, First[First[FactorInteger[p]]]], {n, 1, 38}]; b
    A137957[n_] := FromDigits[Flatten[Reverse /@ IntegerDigits[Range[n]]]];
    Table[FactorInteger[A137957[n]][[1, 1]], {n, 39}] (* Robert Price, May 10 2019 *)

Extensions

a(39)-a(69) from Robert Price, May 10 2019

A259937 Concatenation of the numbers from 1 to n with numbers from n down to 1.

Original entry on oeis.org

11, 1221, 123321, 12344321, 1234554321, 123456654321, 12345677654321, 1234567887654321, 123456789987654321, 1234567891010987654321, 12345678910111110987654321, 123456789101112121110987654321
Offset: 1

Views

Author

Keywords

Comments

For n < 700, only a(1) and a(10) are primes.

Examples

			a(1) = 11.
a(5) = 1234554321.
		

Crossrefs

Programs

  • Mathematica
    FromDigits /@ Flatten /@ IntegerDigits /@ (#~Join~Reverse@ # & /@ Table[Range@ n, {n, 12}]) (* Michael De Vlieger, Jul 10 2015 *)
  • PARI
    a(n)=my(r="");for(i=0,n-1,r=concat(n-i,concat(r,n-i))); eval(r); \\ Anders Hellström, Aug 16 2015
    
  • Python
    from itertools import chain
    def A259937(n): return int(''.join(str(d) for d in chain(range(1,n+1),range(n,0,-1)))) # Chai Wah Wu, Dec 20 2021

Formula

a(n) = A007908(n) concatenated with A000422(n).

A138961 a(n) = largest prime divisor of A138957(n).

Original entry on oeis.org

1, 3, 41, 617, 823, 643, 9721, 14593, 3803, 14405693, 10939223, 4156374407, 2663693, 5603770631, 1221751714624799, 287108811653770498027, 74103167823547, 11843077531813991, 726216405947772436185983423, 769725127, 18274551225153265813469
Offset: 1

Views

Author

Artur Jasinski, Apr 04 2008

Keywords

Comments

For smallest prime divisors see A138960.

Crossrefs

Programs

  • Mathematica
    a = {}; b = {}; Do[w = RealDigits[n]; w = First[w]; Do[AppendTo[a, w[[Length[w] - k + 1]]], {k, 1, Length[w]}]; p = FromDigits[a]; AppendTo[b, First[Last[FactorInteger[p]]]], {n, 1, 18}]; b
    A137957[n_] := FromDigits[Flatten[Reverse /@ IntegerDigits[Range[n]]]];
    Table[First[Last[FactorInteger[A137957[n]]]], {n, 39}] (* Robert Price, May 10 2019 *)

A138962 a(1) = 1, a(n) = the smallest prime divisor of A138793(n).

Original entry on oeis.org

1, 3, 3, 29, 3, 3, 19, 3, 3, 457, 3, 3, 16087, 3, 3, 35963, 3, 3, 167, 3, 3, 7, 3, 3, 13, 3, 3, 953, 3, 3, 7, 3, 3, 548636579, 3, 3, 19, 3, 3, 71, 3, 3, 13, 3, 3, 89, 3, 3, 114689, 3, 3, 17, 3, 3, 12037, 3, 3, 7, 3, 3
Offset: 1

Views

Author

Artur Jasinski, Apr 04 2008

Keywords

Comments

a(61) > 10^11. - Robert Price, Mar 22 2015

Crossrefs

Programs

  • Mathematica
    b = {}; a = {}; Do[w = RealDigits[n]; w = First[w]; Do[AppendTo[a, w[[k]]], {k, 1, Length[w]}]; p = FromDigits[Reverse[a]]; AppendTo[b, First[First[FactorInteger[p]]]], {n, 1, 31}]; b (* Artur Jasinski, Apr 04 2008 *)
    lst = {}; Table[First[First[FactorInteger[FromDigits[Reverse[lst = Join[lst,IntegerDigits[n]]]]]]], {n, 1, 60}] (* Robert Price, Mar 22 2015 *)
  • PARI
    f(n) = my(D = Vec(concat(apply(s->Str(s), [1..n])))); eval(concat(vector(#D, k, D[#D-k+1]))); \\ A138793
    a(n) = my(k=f(n)); forprime(p=2, 10^6, if(k%p == 0, return(p))); if(n == 1, 1, vecmin(factor(k)[,1])); \\ Daniel Suteu, May 27 2022

Formula

a(n) = A020639(A138793(n)). - Daniel Suteu, May 27 2022

Extensions

a(32)-a(60) from Robert Price, Mar 22 2015

A019566 The differences 1-1, 21-12, 321-123, ..., 10987654321-12345678910, 1110987654321-1234567891011, etc.

Original entry on oeis.org

0, 9, 198, 3087, 41976, 530865, 6419754, 75308643, 864197532, -1358024589, -123580236690, -2345801446791, 775432077543108, 178553219976533007, 27956332009875522906, 3805734210999774512805, 481583522109989673502704, 58259362312008979572492603
Offset: 1

Views

Author

Keywords

Comments

All terms are divisible by 9, cf. A083449. There is an increasingly longer subsequence of negative terms starting at each power of 10, namely for indices n = 10..12, 100..123, 1000..1234, etc. - M. F. Hasler, Nov 02 2016
Gupta (1988) calls these "unique numbers".

References

  • S. S. Gupta, Unique Numbers, Science Today, Jan 01 1988, India.

Crossrefs

Programs

  • Maple
    u:= proc(n) u(n):= `if`(n=1, 1, parse(cat(u(n-1), n))) end:
    d:= proc(n) d(n):= `if`(n=1, 1, parse(cat(n, d(n-1)))) end:
    a:= n-> d(n)-u(n):
    seq(a(n), n=1..20);  # Alois P. Heinz, Dec 06 2014
  • Mathematica
    f[n_] := Block[ {a = "", k = 1}, While[k < n + 1, a = StringJoin[ ToString[k], a]; k++ ]; Return[ ToExpression[a] - ToExpression[ StringReverse[a]]]]; Table[ f[n], {n, 1, 17} ]
  • PARI
    A = vector(25); c = 1; f = 1; for (i = 2, 9, c = 10*c + i; f = f + i*10^(i - 1); A[i] = (f - c)); for (i = 10, 25, c = 100*c + i; f = f + i*10^(2*i - 11);; A[i] = (f - c)); A \\ David Wasserman, Nov 09 2004
    
  • PARI
    apply( {A019566(n)=A000422(n)-A007908(n)}, [1..22]) \\ Replacing code from Jan 13 2013, following a comment from Nov 02 2016. - M. F. Hasler, Nov 07 2020

Formula

a(n) = A000422(n) - A007908(n) = 9*A083449(n).

Extensions

More terms from Robert G. Wilson v, Jan 11 2002
More terms from David Wasserman, Nov 09 2004
Edited by N. J. A. Sloane, Nov 22 2020

A038394 Concatenate first n primes in reverse order.

Original entry on oeis.org

2, 32, 532, 7532, 117532, 13117532, 1713117532, 191713117532, 23191713117532, 2923191713117532, 312923191713117532, 37312923191713117532, 4137312923191713117532, 434137312923191713117532, 47434137312923191713117532, 5347434137312923191713117532
Offset: 1

Views

Author

M. I. Petrescu (mipetrescu(AT)yahoo.com)

Keywords

References

  • F. Smarandache, Sequences of Numbers Involved in Unsolved Problems, Hexis, Phoenix, 2006.

Crossrefs

Programs

  • Haskell
    a038394 n = a038394_list !! (n-1)
    a038394_list = f "" a000040_list where
       f xs (q:qs) = (read ys :: Integer) : f ys qs
         where ys = show q ++ xs
    -- Reinhard Zumkeller, Mar 03 2014
    
  • Mathematica
    Join[{s = 2}, Table[s = FromDigits[Flatten[IntegerDigits[{Prime[n], s}]]], {n, 2, 13}]] (* Jayanta Basu, Jul 14 2013 *)
  • PARI
    a(n) = fromdigits(concat([digits(p) | p<-Vecrev(primes(n))])); \\ Andrew Howroyd, Aug 29 2020

Extensions

Offset corrected by Reinhard Zumkeller, Mar 03 2014

A050682 Positions of 5's in A048288.

Original entry on oeis.org

9, 20, 22, 24, 28, 33, 40, 46, 56, 61, 72, 87
Offset: 1

Views

Author

Patrick De Geest, Aug 15 1999

Keywords

Crossrefs

Extensions

a(11)-a(12) from Sean A. Irvine, Aug 17 2021
Offset changed to 1 by Jinyuan Wang, Sep 04 2021

A057138 Add (n mod 10)*10^(n-1) to the previous term, with a(0) = 0.

Original entry on oeis.org

0, 1, 21, 321, 4321, 54321, 654321, 7654321, 87654321, 987654321, 987654321, 10987654321, 210987654321, 3210987654321, 43210987654321, 543210987654321, 6543210987654321, 76543210987654321, 876543210987654321
Offset: 0

Views

Author

Henry Bottomley, Aug 12 2000

Keywords

Comments

Original definition: "Concatenate next digit at left hand end."
This is misleading, since the concatenation of 0 yields the same term (leading zeros vanish), but upon the next concatenation of 1, the 0 reappears - except for a(1), which according to that description should equal a(1)=10: It is surprising that in this only case where the 0 is indeed present, it disappears upon left-concatenation of the digit 1! - M. F. Hasler, Jan 13 2013
From Hieronymus Fischer, Jan 23 2013: (Start)
A definition which is also consistent is: Start with terms 0 and 1 and then concatenate the next digit at the left hand end. If the next digit is a zero, keep this zero in mind so that the following digit is a 1 preceding a 0.
The sequence terms are the terms of A057137 in reversed digit order. Based on this understanding, the anomaly for the indices 0 and 1 where the terms are 0 and 1 instead of 0 and 10 (what one would expect) becomes self-explaining. Also, the special behavior when the zero digit is encountered becomes clear.
Examples: a(3) = 321 = Reversal(A057137(3)),
a(10) = 987654321 = Reversal(A057137(10)) = Reversal(1234567890). (End)

Crossrefs

Alternative progression for n >= 10 compared with A000422 and A014925.
Cf. A057137 for reverse.

Programs

  • Maple
    ListTools:-PartialSums([seq((k mod 10)*10^(k-1), k=0..40)]); # Robert Israel, Jun 21 2017
  • Mathematica
    Join[{c = 0}, Table[c = c + Mod[n, 10]*10^(n - 1), {n, 18}]] (* T. D. Noe, Jan 30 2013 *)
    nxt[{n_,a_}]:={n+1,a+Mod[n+1,10]10^n}; NestList[nxt,{0,0},20][[;;,2]] (* Harvey P. Dale, Apr 06 2025 *)
  • PARI
    a(n)=sum(i=0,n,i%10*10^(i-1)) \\ M. F. Hasler, Jan 13 2013

Formula

a(n) = a(n-1) + 10^(n-1)*n - 10^n*floor(n/10) = A057139(n) mod 10^n.
a(n) = floor(((q/(10^10 - 1)) + q mod 10^(n mod 10))*10^(10*floor(n/10))), where q = 987654321. - Hieronymus Fischer, Jan 03 2013
G.f.: x(1-10(10x)^9 + 9(10x)^10)/((1-x) (1-10x)^2 (1-(10x)^10)). - Robert Israel, Jun 21 2017

Extensions

Better definition from M. F. Hasler, Jan 13 2013
Previous Showing 31-40 of 72 results. Next