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 11-20 of 31 results. Next

A329623 The absolute value of the difference between n and A053392(n), the concatenation of the sums of every pair of consecutive digits of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 63
Offset: 0

Views

Author

Scott R. Shannon, Nov 19 2019

Keywords

Comments

As A040115 forms the basis of an iterative sequence leading to A329200 and A329201, this sequence forms the basis of a similar sequence A329624. As the concatenation of the digit sum can lead to a value larger than the original term we must take the absolute value of the difference to ensure subsequent terms are always positive. The largest value in the first 10000 terms is a(9991) = 171819.

Examples

			a(9) = 9 as A053392(9) = 0 and | 9 - 0 | = 9.
a(10) = 10 as A053392(10) = 1 and | 10 - 1 | = 9.
a(100) = 90 as A053392(100) = 10 and | 100 - 10 | = 90.
a(119) = 91 as A053392(119) = 210 and | 119 - 210 | = 91.
		

Crossrefs

Programs

A040114 List of absolute values of differences between digits of 10, 11, 12, ..., listed digit by digit.

Original entry on oeis.org

1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 0, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5
Offset: 10

Views

Author

Keywords

Comments

Start with the empty sequence. For n = 10, 11, 12, ... do the following. Let the decimal expansion of n be abcd...efg, say. Append the numbers |a-b|, |b-c|, |c-d|, ... |e-f|, |f-g| to the sequence.
The offset is slightly misleading since for n > 99 the index n is in no direct relation with the number whose digits are used to produce a(n), in contrast to A040115 where all digit-differences of n are concatenated, and leading zeros don't appear. For example, a(100) = 1 and a(101) = 0 are the two differences between the digits of 100. Similarly, a(100 + 2k) corresponds to the difference between first and second digit of 100 + k. Therefore, a(120) = 0. - M. F. Hasler, Nov 09 2019

Examples

			From _M. F. Hasler_, Nov 09 2019: (Start)
The first term is the difference between digits of 10, which is 1.
The second term is the difference between digits of 11, which is 0.
The 100th term is the difference between the first two digits of 100, 1-0 = 1.
The 101st term is the difference between the last two digits of 100, 0-0 = 0.
The 120th term is the difference between the first two digits of 110, 1-1 = 0: Here "leading zeros" are preserved, in contrast to A040115 where all digit-wise differences of any n are concatenated to one term, and leading zeros disappear.
(End)
When we reach n = 371, for example, we append 4 and 6 to the sequence.
		

Crossrefs

Programs

  • Mathematica
    Flatten[Table[Abs[Differences[IntegerDigits[n]]],{n,10,200}]] (* Harvey P. Dale, Jun 28 2021 *)

Extensions

Definition clarified by N. J. A. Sloane, Aug 19 2008.
Name edited by M. F. Hasler, Nov 09 2019

A080465 Absolute difference between the two numbers formed by alternate digits of n.

Original entry on oeis.org

1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 6, 5, 4, 3, 2, 1, 0, 1, 2, 3, 7, 6, 5, 4, 3, 2, 1, 0, 1, 2, 8, 7, 6, 5, 4, 3, 2, 1, 0, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 9
Offset: 10

Views

Author

Amarnath Murthy, Mar 02 2003

Keywords

Comments

Differs from A040115 first at a(110) = 9. - R. J. Mathar, Sep 19 2008

Examples

			a(132546) = |124 - 356| = 232.
		

Crossrefs

See also A040997.

Programs

  • PARI
    A080465(n)=abs(vector(#n=digits(n),j,(-1)^j*10^((#n-j)\2))*n~) \\ M. F. Hasler, Jan 10 2016

Extensions

More terms from Ray Chandler, Oct 11 2003

A329196 Irregular table whose rows are the nontrivial cycles of the ghost iteration A329200, ordered by increasing smallest member, always listed first.

Original entry on oeis.org

10891, 12709, 11130, 11107, 11090, 43600, 44960, 45496, 44343, 44232, 44021, 74780, 78098, 76207, 75800, 78180, 79958, 77915, 78199, 79979, 82001, 110891, 112709, 111130, 111107, 111090, 180164, 258316, 224791, 227119, 232727, 221172, 220107, 217990, 201781
Offset: 1

Views

Author

M. F. Hasler, Nov 10 2019

Keywords

Comments

A329200 consists of adding the number whose digits are the absoute values of differences of adjacent digits of n in case it is even, or subtracting it if it is odd. Repdigits A010785 are fixed points of this map, but some numbers enter nontrivial cycles. This sequence lists these cycles, ordered by their smallest member which is always listed first. Sequence A329197 gives the row lengths.
Whenever all terms of a cycle have the same number of digits and same initial digit, then this digit can be prefixed k times to each term to obtain a different cycle of same length, for any k >= 0. (The corresponding "ghosts" A040115(n) are then the same, so the (cyclic) first differences are also the same and add again up to 0.) This is the case for rows 1, 2, 3, ... (but not row 4 or 6) of this table. Rows 5, 7 and 8 are the second members of these three families. We could call "primitive" the cycles which are not obtained from an earlier cycle by duplicating the initial digits.

Examples

			The table starts:
   n |  cycle #n  (length = A329197(n))
  ---+-----------------------------------------------------------------------
   1 |  10891,  12709,  11130,  11107,  11090
   2 |  43600,  44960,  45496,  44343,  44232,  44021
   3 |  74780,  78098,  76207
   4 |  75800,  78180,  79958,  77915,  78199,  79979, 82001
   5 | 110891, 112709, 111130, 111107, 111090
   6 | 180164, 258316, 224791, 227119, 232727, 221172, 220107, 217990, 201781
   7 | 443600, 444960, 445496, 444343, 444232, 444021
   8 | 774780, 778098, 776207
   9 | 858699, 891929, 873052
  10 | 1110891, 1112709, 1111130, 1111107, 1111090
  11 | 3270071, 3427147, 3301514
  12 | 4381182, 4538258, 4412625
  13 | 4443600, 4444960, 4445496, 4444343, 4444232, 4444021
  14 | 5492293, 5649369, 5523736
  15 | 7774780, 7778098, 7776207
  16 | 8858699, 8891929, 8873052
  17 | 11110891, 11112709, 11111130, 11111107, 11111090
  18 | 33270071, 33427147, 33301514
  19 | 44381182, 44538258, 44412625
  20 | 44443600, 44444960, 44445496, 44444343, 44444232, 44444021
  21 | 55492293, 55649369, 55523736
  22 | 77774780, 77778098, 77776207
  23 | 85869922, 89192992, 87305285
  24 | 88858699, 88891929, 88873052
  25 | 111110891, 111112709, 111111130, 111111107, 111111090
  26 | 333270071, 333427147, 333301514
  27 | 444381182, 444538258, 444412625
  28 | 444443600, 444444960, 444445496, 444444343, 444444232, 444444021
  29 | 555492293, 555649369, 555523736
  30 | 615930235, 670393447, 653027344, 665352754, 664129233, 666446943,
     | 666244592, 665824445, 664462444, 666486644, 666728664, 666884866,
     | 667089286, 668871048, 670887192, 653085505, 640702450
  31 | 777774780, 777778098, 777776207
  32 | 809513051, 898955405, 887815260, 888989606, 889100972, 887290047,
     | 885711004, 888971108, 889097126, 891089740, 909270974
  33 | 858699257, 891929989, 873052978
  34 | 885869922, 889192992, 887305285
  35 | 888858699, 888891929, 888873052
  36 | 1111110891, 1111112709, 1111111130, 1111111107, 1111111090
  37 | 3333270071, 3333427147, 3333301514
  38 | 4444381182, 4444538258, 4444412625
  39 | 4444443600, 4444444960, 4444445496, 4444444343, 4444444232, 4444444021
  40 | 5461740619, 5587375277, 5618817627, 5461741482, 5587374828, 5618818294
  41 | 5555492293, 5555649369, 5555523736
  42 | 6615930235, 6670393447, 6653027344, 6665352754, 6664129233,
     | 6666446943, 6666244592, 6665824445, 6664462444, 6666486644,
     | 6666728664, 6666884866,
     | 6667089286, 6668871048, 6670887192, 6653085505, 6640702450
  43 | 7777774780, 7777778098, 7777776207
  44 | 8858699257, 8891929989, 8873052978
  45 | 8885869922, 8889192992, 8887305285
  46 | 8888858699, 8888891929, 8888873052
  47 | 11111110891, 11111112709, 11111111130, 11111111107, 11111111090
  48 | 31128941171, 33145094237, 33376689451, 33417710965, 33281649034,
     | 33114123103, 32910811890
  49 | 44444443600, 44444444960, 44444445496, 44444444343,
     | 44444444232, 44444444021
The smallest starting value for which the trajectory under A329200 does not end in a fixed point is n = 8059: This leads into a cycle of length 5, 11090 -> 10891 -> 12709 -> 11130 -> 11107 -> 11090. "Rotated" as to start with the smallest member, this yields the first row of this table, (10891, 12709, 11130, 11107, 11090).
Starting value n = 37908 leads after two steps into the next cycle (44232, 44021, 43600, 44960, 45496, 44343), of length 6. Again "rotating" this list as to start with the smallest member, it yields the second row of this table.
Starting value n = 68060 leads after 8 steps into a new cycle of length 7, (75800, 78180, 79958, 77915, 78199, 79979, 82001). However, this will NOT give row 3 but only row 4, because:
The starting value 70502 leads after 3 steps into the loop (74780, 78098, 76207) which comes lexicographically earlier than the previously mentioned cycle of length 7. Therefore this is row 3 of this table.
Starting value 70515 enters the loop (111090, 110891, 112709, 111130, 111107) after 15 steps. This becomes row 5.
This row 5 is the same as row 1 with the initial digit 1 duplicated in each term: it is the second member of this infinite family of cycles of length 5. Similarly, rows 2 and 3 (where all terms have the same length and initial digit) also lead to infinite families of cycles by successively duplicating the initial digit of each term.
The pattern 858699257(257|857)*84302(302|342)* also yields cycles. - _Lars Blomberg_, Nov 15 2019
		

Crossrefs

Cf. A329197 (row lengths), A329200, A329198.
Cf. A329342 (analog for the variant A329201).

Programs

  • PARI
    T(n,T=[n])={while(!setsearch(Set(T),n=A329200(n)), T=concat(T,n));T} /* trajectory; is a cycle when n is a member of it */
    {U=0; M=[]; for(n=9,oo, bittest(U>>=1,0) && next; if(M && n>M[1], print(T(M[1])); M=M[^1]); t=n; V=U; while( !bittest(U,-n+t=A329200(t)), t>n || next(2); U+=1<<(t-n)); bittest(V,t-n) || #Set(digits(t))==1 || M=setunion(M,[vecmin(T(t))]) )}

Extensions

Rows 9 through 35 from Scott R. Shannon, Nov 12 2019
Table of cycles extended by Lars Blomberg, Nov 15 2019

A329342 Irregular table whose rows list the nontrivial cycles of the ghost iteration A329201, starting with the smallest member.

Original entry on oeis.org

8290, 8969, 9102, 17998, 24199, 21819, 20041, 22084, 21800, 20020, 21901, 23792, 25219, 54503, 55656, 55767, 55978, 56399, 55039, 87290, 88869, 88892, 88909, 89108, 108070, 126947, 141300, 221901, 223792, 225219, 554503, 555656, 555767, 555978, 556399, 555039
Offset: 1

Views

Author

M. F. Hasler, Nov 10 2019

Keywords

Comments

A329201 consists of adding or subtracting the number whose digits are the differences of adjacent digits of n, depending on its parity. Repdigits A010785 are fixed points of this map, but some numbers enter nontrivial cycles.
This sequence lists these cycles, ordered by their smallest member which is always listed first.
Sequence A329341 gives the lengths of these cycles, i.e., rows of this table.
Whenever all terms of a cycle have the same number of digits and same initial digit, then this digit can be prefixed k times to each term to obtain a different cycle of same length, for any k >= 0. (The corresponding "ghosts" A040115(n) are then the same, so the first differences are also the same and add again up to 0.) This is the case for rows 3, 4, 5, 6, ... of this table. Rows 7, 8, 11, ... are subsequent members of the respective family. We could call "primitive" the cycles which are not obtained from an earlier cycle by duplicating the initial digits.

Examples

			The table starts:
   n |  cycle #n  (length = A329341(n))
  ---+------------------------------------------------------------------
   1 |  8290,    8969,   9102
   2 |  17998,  24199,  21819,  20041,  22084,  21800, 20020
   3 |  21901,  23792,  25219
   4 |  54503,  55656,  55767,  55978,  56399,  55039
   5 |  87290,  88869,  88892,  88909,  89108
   6 | 108070, 126947, 141300
   7 | 221901, 223792, 225219
   8 | 554503, 555656, 555767, 555978, 556399, 555039
   9 | 741683, 775208, 772880, 767272, 778827, 779892, 782009, 798218, 819835
  10 | 810001, 881002, 873900, 859210, 893921,
     | 910592, 992139, 985013, 971501, 997952, 1000195, 900011
  11 | 887290, 888869, 888892, 888909, 889108
  12 | 1108070, 1126947, 1141300
  13 | 2221901, 2223792, 2225219
  14 | 4350630, 4476263, 4507706
  15 | 5461741, 5587374, 5618817
  16 | 5554503, 5555656, 5555767, 5555978, 5556399, 5555039
  17 | 6572852, 6698485, 6729928
  18 | 8887290, 8888869, 8888892, 8888909, 8889108
  19 | 9071007, 10047114, 11090717, 10890951
  20 | 10807007, 12694714, 14130077
  21 | 11108070, 11126947, 11141300
  22 | 22221901, 22223792, 22225219
  23 | 44350630, 44476263, 44507706
  24 | 55461741, 55587374, 55618817
  25 | 55554503, 55555656, 55555767, 55555978, 55556399, 55555039
  26 | 66572852, 66698485, 66729928
  27 | 88887290, 88888869, 88888892, 88888909, 88889108
  28 | 90710050, 100471105, 110907120, 108909508
  29 | 98311327, 99831542, 99679130, 99991953, 99983111,
     | 99967911, 99936631, 99873599, 99759359, 99534735, 99113393
  30 | 108070010, 126947021, 141300742
  31 | 110807007, 112694714, 114130077
  32 | 111108070, 111126947, 111141300
  33 | 222221901, 222223792, 222225219
  34 | 329112807, 346914494, 359297549, 384069764, 329606552,
     | 346972655, 334647245, 335870766, 333553056, 333755407,
     | 334175554, 335537555, 333513355, 333271335, 333115133, 332910713, 331128951
  35 | 444350630, 444476263, 444507706
  36 | 555461741, 555587374, 555618817
  37 | 555554503, 555555656, 555555767, 555555978, 555556399, 555555039
  38 | 666572852, 666698485, 666729928
  39 | 829021565, 896942976, 910295697
  40 | 888887290, 888888869, 888888892, 888888909, 888889108
  41 | 998311327, 999831542, 999679130, 999991953, 999983111,
     | 999967911, 999936631, 999873599, 999759359, 999534735, 999113393
		

Crossrefs

Cf. A329341 (row lengths), A329201, A329196 (analog for A329200), A329198.

Programs

  • PARI
    T(n,T=[n])={while(!setsearch(Set(T),n=A329201(n)), T=concat(T,n));T} \\ trajectory; a cycle if n is a member of it.
    {U=0; M=[]; for(n=9, oo, bittest(U>>=1, 0) && next; if(M && n>M[1], print(T(M[1])); M=M[^1]); t=n; V=U; while( !bittest(U, -n+t=A329201(t)), t>n || next(2); U+=1<<(t-n)); bittest(V, t-n) || #Set(digits(t))==1 || M=setunion(M, [vecmin(T(t))]) )}

Extensions

Rows 12 through 41 from Scott R. Shannon, Nov 12 2019

A087599 Smallest nonzero n-digit term of A087597, or 0 if no such number exists.

Original entry on oeis.org

1, 10, 105, 2211, 16836, 105111, 2220778, 14319276, 221098906, 1087061878, 11402689605, 223577504556, 1264725045100, 50869724563503, 111335989114503, 2399795843858155, 11141229266441550, 127955437456464996, 1070124037258522456
Offset: 1

Views

Author

Amarnath Murthy, Sep 18 2003

Keywords

Comments

Conjecture: No term is zero.

Examples

			a(4) = 2211, A040115(2211) = 10.
		

Crossrefs

Programs

  • PARI
    dd(k)={ local(kshf,res,dig,odig,p) ; kshf=k ; res=0 ; odig=kshf % 10 ; p=0 ; while(kshf>9, kshf=floor(kshf/10) ; dig=kshf % 10 ; res += 10^p*abs(dig-odig) ; odig=dig ; p++ ; ) ; return(res) ; } isA000217(n)={ if( issquare(1+8*n), return(1), return(0) ) ; } A000217(n)={ return(n*(n+1)/2) ; } ndigs(n)={ local(nshft,res) ; res=0 ; nshft=n; while(nshft>0, res++ ; nshft=floor(nshft/10) ; ) ; return(res) ; } isA087597(n)={ if( isA000217(n) && isA000217(dd(n)), return(1), return(0) ) ; } A087599(n)={ local(k,T) ; k=floor(-0.5+sqrt(0.25+2*10^(n-1))) ; T=A000217(k) ; if(ndigs(T)A000217(k) ; if(ndigs(T)>n, return(0) ) ; if( isA087597(T), return(T) ) ; k++ ; ) ; } { for(n=2,21, print1(A087599(n),",") ; ) ; } \\ R. J. Mathar, Nov 19 2006

Extensions

Corrected and extended by R. J. Mathar, Nov 19 2006
a(14)-a(18) from Donovan Johnson, May 08 2010
a(19) from Donovan Johnson, Jun 19 2011
a(1)=1 prepended by Max Alekseyev, Jul 27 2024

A087600 Largest n-digit term of A087597, or 0 if no such number exists.

Original entry on oeis.org

6, 78, 666, 7503, 82621, 828828, 7552441, 87311505, 557362578, 9901692450, 88893307128, 934624072410, 9836548472766, 99245275962778, 994337011743076, 5535761776004778, 89253915287999385, 865474782199906830, 9888742361454004621
Offset: 1

Views

Author

Amarnath Murthy, Sep 18 2003

Keywords

Comments

Conjecture: No term is zero.

Examples

			a(4) = 7503, A040115(7503) = 253 is triangular.
		

Crossrefs

Programs

  • PARI
    dd(k)={ local(kshf,res,dig,odig,p) ; kshf=k ; res=0 ; odig=kshf % 10 ; p=0 ; while(kshf>9, kshf=floor(kshf/10) ; dig=kshf % 10 ; res += 10^p*abs(dig-odig) ; odig=dig ; p++ ; ) ; return(res) ; } isA000217(n)={ if( issquare(1+8*n), return(1), return(0) ) ; } A000217(n)={ return(n*(n+1)/2) ; } ndigs(n)={ local(nshft,res) ; res=0 ; nshft=n; while(nshft>0, res++ ; nshft=floor(nshft/10) ; ) ; return(res) ; } isA087597(n)={ if( isA000217(n) && isA000217(dd(n)), return(1), return(0) ) ; } A087600(n)={ local(k,T) ; k=ceil(-0.5+sqrt(0.25+2*10^n)) ; T=A000217(k) ; if(ndigs(T)>n, k-- ) ; while(1, T=A000217(k) ; if(ndigs(T)A087597(T), return(T) ) ; k-- ; ) ; } { for(n=2,21, print1(A087600(n),",") ; ) ; } \\ R. J. Mathar, Nov 19 2006

Extensions

More terms from R. J. Mathar, Nov 19 2006
a(16)-a(18) from Donovan Johnson, Jul 28 2010
a(19) from Donovan Johnson, Jun 19 2011
a(1)=6 prepended by Max Alekseyev, Jul 27 2024

A271639 Orphans: integers without ancestors, in the sense explained below.

Original entry on oeis.org

648, 649, 659, 737, 738, 739, 747, 748, 749, 758, 759, 769, 828, 829, 837, 838, 839, 846, 847, 848, 849, 857, 858, 859, 868, 869, 879, 919, 928, 929, 937, 938, 939, 946, 947, 948, 949, 956, 957, 958, 959, 967, 968, 969, 978, 979, 989, 1648, 1649, 1659, 1737, 1738
Offset: 1

Views

Author

Eric Angelini and Jean-Marc Falcoz, Apr 11 2016

Keywords

Comments

Look at
2.0.1.6
.2.1.5
We see that 2016 produces 215 if we consider the successive absolute differences of 2016's digits. We call 2016 an "ancestor" of 215. Some integers have many ancestors -- 215 has 28, for example -- and some, the "orphans", have none. The smallest is 648, which is therefore the initial term.
Also numbers that do not appear in A040115. - Rémy Sigrist, Jun 10 2017
If n is in the sequence, then so are all numbers that start or end with n or are obtained from n by inserting zeros. - Robert Israel, May 27 2019
Eventually almost all numbers are orphans, because there are some impossible substrings, like 919, and any number containing the bad substring is also an orphan. And the fraction of numbers containing any single substring rises asymptotically to 1 (albeit usually slowly). - Allan C. Wechsler, Oct 31 2019.

Crossrefs

Cf. A040115.

Programs

  • Maple
    filter:= proc(n) local t,L,i;
         L:= convert(n,base,10);
         t:= {$1..9};
         for i from 1 to nops(L) do
           t:= select(d -> d >= 0 and d <= 9, map(d -> (d+L[i],d-L[i]), t));
           if t = {} then return true fi
         od;
    false
    end proc:
    select(filter, [$1..2000]); # Robert Israel, May 27 2019
  • PARI
    \\ Needs PARI from A327270.
    select(k->A327270(k)<0, [1..1800]) \\ Andrew Howroyd, Dec 10 2024

A331163 a(n) is the number of occurrences of the most frequently seen difference between adjacent digits in the concatenation of a(0) to a(n-1), with a(0) = 0, a(1) = 0.

Original entry on oeis.org

0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 12, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, 20, 21, 21, 21, 21, 22, 23, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 30, 31, 31, 31, 31, 31
Offset: 0

Views

Author

Scott R. Shannon, Jan 11 2020

Keywords

Comments

In the first 10 million terms the most frequently seen digit difference is 1, which leads other digit difference counts for 2589052 terms. The least seen is 9, which only holds the lead for 990 terms and does not become the most frequently seen digit difference until a(23521), after a run of 1228 consecutive terms of 9090. The longest series of unchanging terms begins at a(7727945) = 7040480 which begins a run of 94553 consecutive terms of 7040480.

Examples

			a(2) = 1 as the concatenation of a(0) and a(1) = '00', and the only adjacent digit difference in '00' is 0, and that difference has occurred one time.
a(3) = 1 as the adjacent digit differences in '001' are 0 and 1, both of which have occurred one time.
a(4) = 2 as '0011' contains two pairs of adjacent digits which differ by 0.
a(22) = 12 as '001122334455667788991010' contains twelve pairs of adjacent digits which differ by 1.
		

Crossrefs

Cf. A040115.

Programs

  • Maple
    DC:= [0]: last:= 0:
    Res:= 0,0:
    Ct:= Array(0..9):
    Ct[0]:= 1:
    for n from 2 to 100 do
      v:= max(Ct);
      Res:= Res, v;
      L:= [last,op(ListTools:-Reverse(convert(v,base,10)))];
      DL:= map(abs,L[2..-1]-L[1..-2]);
      last:= L[-1];
      for i from 1 to nops(DL) do
        Ct[DL[i]]:= Ct[DL[i]]+1
      od;
    od:
    Res; # Robert Israel, Jan 16 2020

A334387 The difference version of the 'Decade transform' : to obtain a(n) write n as a sum of its power-of-ten parts and then continue to calculate the absolute value of the difference between the adjacent parts until a single number remains.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Apr 26 2020

Keywords

Comments

To obtain the difference version of the 'Decade transform' of n first write n as a sum of its power-of-ten parts and then continue to calculate the absolute value of the difference between the adjacent parts until a single number remains. See the Examples for details.
See A330859 for the additive version of the same transform.

Examples

			Let n = 32871. Write n as a sum of its power-of-ten parts:
32871 = 30000+2000+800+70+1
Now take the absolute value of the difference between the adjacent numbers in this sum:
30000+2000+800+70+1 -> (|30000-2000|):(|2000-800|):(|800-70|):(|70-1|) = 28000:1200:730:69
Now repeat this until a single number remains:
28000:1200:730:69 -> 26800:470:661
26800:470:661 -> 26330:191
26330:191 -> 26139
Thus a(32871) = 26139.
Other examples:
a(11) = 9 as 11 = 10+1 thus 10:1 -> 9.
a(19) = 1 as 19 = 10+9 thus 10:9 -> 1.
a(20) = 20 as 20 = 20+0 thus 20:0 -> 20.
a(67) = 53 as 67 = 60+7 thus 60:7 -> 53.
a(1234) = 486 as 1234 = 1000+200+30+4 thus 1000:200:30:4 -> 800:170:26 -> 630:144 -> 486.
a(15010) = 0 as 15010 = 10000+5000+0+10+0 thus 10000:5000:0:10:0 -> 5000:5000:10:10 -> 0:4990:0 -> 4990:4990 -> 0.
		

Crossrefs

Previous Showing 11-20 of 31 results. Next