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

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

A328142 Elements of cycles for iterations of A329623: n -> |n - concat(sum of adjacent digits of n)|.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 182, 273, 364, 455, 546, 637, 728, 1728, 2637, 3546, 4455, 5364, 6273, 7182, 17182, 26273, 35364, 44455, 53546, 62637, 71728, 171728, 262637, 353546, 444455, 535364, 626273, 717182, 1717182, 2626273, 3535364, 4444455, 5353546, 6262637, 7171728
Offset: 1

Views

Author

M. F. Hasler, Dec 02 2019

Keywords

Comments

Equivalently: range of A328865 \ {-1}.
By a k-cycle (or cycle of length k) of A329623 we mean a vector (x_1, ..., x_k) such that A329623(x_i) = x_{i+1} for i < k, and A329623(x_k) = x_1. We include here the cycles of length k = 1 which are the fixed points of A329623, viz A329623(x_1) = x_1. No cycle with k > 2 is known.
There are 7 infinite subsequences: for initial digit 1 <= d <= 7, alternate digit d and 8-d to form an undulating (A033619) number of arbitrary length L >= 3, then add 11.
The terms with initial digit d > 4 are the larger member of a 2-cycle having a term with d < 4 as smaller member. The terms with d = 4 (and those <= 9) are fixed points. So far no other fixed points or other cycles are known. As far as this remains valid, the terms of this sequence are characterized by A329623(A329623(x)) = x.
Sequence A328279 lists the smallest member of each cycle.

Examples

			The single-digit numbers 1, ..., 9 and the numbers f(k) = 4*(10^k-1)/9 + 11, k >= 3, are fixed points of A329623.
Indeed, for f(k) = 4...455 we have A053392(f(k)) = 8...910 = 2*f(k), so A329623(f(k)) = 2*f(k) - f(k) = f(k).
For a(10) = 182, we have A329623(182) = 728 and A329623(728) = 182, so these are members of the 2-cycle (182, 728).
For a(11) = 273, we have A329623(273) = 637 and A329623(637) = 273, so these are members of the 2-cycle (273, 637).
Similarly for all subsequent terms except the f(k) of the form 4...455.
		

Crossrefs

Cf. A329623, A053392 (concatenate sums of adjacent digits of n), A328865, A329624.
See A328279 for the smallest representative of each cycle.

Programs

  • PARI
    apply( {A328142(n)=if(n>9,fromdigits(vector((n+8)\/7,i,n=if(i>1, 8-n,(n+4)%7+1)))+11,n)}, [1..40]) \\ As far as there are no other terms than those described in COMMENTS. - M. F. Hasler, Dec 06 2019, replacing earlier code.

A328865 The first repeating term in the trajectory of n under iterations of A329623, or -1 if no such terms exists.

Original entry on oeis.org

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

Views

Author

Scott R. Shannon, Nov 24 2019

Keywords

Comments

A329623(n) = |n - A053392(n)|, where A053392 is the concatenation of the sums of pairs of consecutive digits.
This is the first number which appears twice for the iteration of A329623 starting with n. See A329624 for an explanation of the sequence, and for the number of iterations required before reaching this value. Terms a(9) to a(127) are all 9's, after which the sequence shows large jumps in value, e.g., a(1673) = 62626262626262626262626262637.
All -1 are so far conjectural, see A329624 and A329917 for more information.
The terms > 0 of this sequence are elements of cycles for A329623. Only 2-cycles and fixed points 1, 2, ..., 9 and 4...455 are known. Therefore a(n) is the earliest A329623^{k}(n) = A329623^{k+2}(n) if such k exist. See A328142 for the list of all possible values and more precise definitions. - M. F. Hasler, Dec 06 2019
The first escape value is a(1373) = -1. - Georg Fischer, Jul 16 2020

Examples

			a(10) = 9 as A329623(10) = 9, and A329623(9) = 9, thus 9 is the first repeating value.
a(128) = 182, as A329623(128) = 182, A329623(182) = 728, A329623(728) = 182, thus 182 is the first repeating value.
a(210) = 637, as A329623(210) = 179, A329623(179) = 637, A329623(637) = 273, A329623(273) = 637, thus 637 is the first repeating value.
		

Crossrefs

Programs

Extensions

Incorrect comment, link and program deleted following an observation by Scott R. Shannon, Nov 27 2019

A329917 Starting values for which iterations of A329623 diverge (conjectural).

Original entry on oeis.org

1373, 1374, 1375, 1376, 1377, 1378, 1379, 1382, 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, 1399, 1591, 1592, 1593, 1594, 1595, 1596, 1597, 1598, 1599, 1891, 1892, 1893, 1894, 1895, 1896, 1897, 1898, 1899, 2373, 2374, 2375, 2376, 2377, 2378, 2379, 2382, 2383, 2384
Offset: 1

Views

Author

Scott R. Shannon, Nov 24 2019

Keywords

Comments

These are the starting values n for which the trajectory under iterations of A329623 grows without limit. See A329624 for an explanation of the sequence.
There are 466 terms below 10000.
From M. F. Hasler, Dec 02 2019: (Start)
There is no term below 10^3, but beyond 10^4 they become much more frequent: roughly 1/3 of all numbers between 10^4 and 5*10^4 are in the sequence.
The sequence consists mostly in runs of consecutive numbers ending with the next larger term with final digit 9: 1373..1379, 1382..1389, 1391..1399, 1591..1599, 1891..1899, 2373..2379, ... In some ranges, like a(152) = 4010 to a(240) = 4181, a(307) = 6010 to a(352) = 6391, a(467) = 10010 to a(556) = 11090, ..., this pattern is reversed: the runs start with a multiple of 10.
However, all these terms are so far only conjectural. We have no proof that the terms for which the trajectory seems to "explode" do not eventually end up in a cycle. For example, the 8th iterate of a(1) = 1373 is 5218725017016262626273. If the 2nd digit is changed from 2 to 0, then the further iterates grow to a length of 52 digits, but finally end up in a 2-cycle of 45-digit numbers (26...26273, 62...62637). (All members of cycles are listed in A328142.)
(End)

Examples

			The first term to diverge is n = 1373. The iterative sequence begins 1373, 39637, 1176273, 26962637, 8124626273, 85486262637, 13826662626273, 411094294626262637, 5218725017016262626273, 68697250170162626262637, 141346472501701626262626273, ... The digits '62637' reappear at the end of the terms every second iteration.
While 50, 500 and 5000 reach the fixed point 9, 455, resp. 4444455 after 5, 3, resp. 8 iterations, the starting value 50000 is in this sequence: after the 10th iteration, the result is of the form 991...903544444455 and keeps this form (prefix alternating with 1810....) with an ever growing string of 4's. - _M. F. Hasler_, Dec 02 2019
		

Crossrefs

Programs

  • PARI
    is_A329917(n, L=n^10, U=[n])=!for(i=1, oo, setsearch(U, n=A329623(n))&&return; nM. F. Hasler, Dec 02 2019

Extensions

Name and comment edited by M. F. Hasler, Dec 02 2019

A328680 The number of iterations before a repeated value appears when starting from n and performing the iterative cycle as described in the comments, which involves setting the next iterative number to either A053392 or A040115 depending on the current numbers' size relative to n.

Original entry on oeis.org

2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5
Offset: 1

Views

Author

Scott R. Shannon, Dec 03 2019

Keywords

Comments

This sequence is based on the following iterative cycle. Start with n, set m = A040115(n), the concatenation of the absolute values of differences between adjacent digits, and then repeat the following until the number m has been previously seen: if m is greater than n, let m = A040115(m), otherwise let m = A053392(m), the concatenation of the sums of pairs of adjacent digits.
For all starting values n the iteration eventually converges to 0 or else goes into a cycle of finite length. When the number m gets larger than the iteration's starting value n it will always have its magnitude decreased by the operation m = A040115(m), while m = A053392(m) can either increase or decrease its magnitude, depending on the digit values of m. This has the overall effect of never allowing the iterative values to increase without limit as is seen in the similar iterations A328975 and A329624.
All the values of A053393 are seen as repeating values in this sequence, although this sequence has significantly more; probably an infinite number, although this is unknown. The first nonzero repeating value is not seen until a(9090), which forms the two-member loop of 999 -> 1818 -> 999. The first starting value that leads to an m value greater than the initial starting value is a(10090), see examples below. A330159 lists the starting values which are also the first repeating value.
For the first 20 million terms the longest iterative sequence is seen for a(18505180) which takes 457 steps before reaching 0. See attached link. The longest found looping sequence is for a(14106482) which reaches 1040103 after 5 steps and then again after 116 steps, forming a loop of length 111. The largest number found which starts the repeating loop is for a(9265011) which reaches 1411131715 after 9 iterations and then again after 41 iterations.
From a(12) to a(99) the sequence repeats a pattern of ten 3's followed by a 2. After that, a(100) = 4 and the terms begin to show a slow average increase in value.

Examples

			a(10) = 3 as A040115(10) = 1, A053392(1) = 0, and A053392(0) = 0, taking three steps to repeat from 10.
a(1060) = 7 as A040115(1060) = 166, A053392(166) = 712, A053392(712) = 83, A053392(83) = 11, A053392(11) = 2, A053392(2) = 0, A053392(0) = 0, taking seven steps to repeat from 1060.
a(10090) = 11 as A040115(10090) = 1099, A053392(1099) = 1918, A053392(1918) = 10109, A040115(10109) = 1119, A053392(1119) = 2210, A053392(2210) = 431, A053392(431) = 74, A053392(74) = 11, A053392(11) = 2, A053392(2) = 0, A053392(0) = 0, taking eleven steps to repeat from 11090.
		

Crossrefs

A330634 The number of iterations of A330633, the concatenation of the product of adjacent digits, for starting value n before reaching 0, or -1 if this never happens.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 1, 2, 2, 3, 3, 2, 3, 4, 3, 4, 1, 2, 2, 3, 2, 3, 2, 4, 2, 3, 1, 2, 3, 3, 3, 2, 4, 3, 4, 3, 1, 2, 3, 3, 4, 4, 3, 5, 3, 4, 1, 2, 3, 3, 3, 2, 4, 3, 4, 4, 1, 2, 3, 4, 4, 3, 3, 4, 4, 3, 1, 1
Offset: 0

Views

Author

Scott R. Shannon, Dec 22 2019

Keywords

Comments

This sequence lists the number of iterations required of the sequence A330633, the concatenation of the product of adjacent digits, for starting value n until the resulting term equals zero. If the iterative cycle never reaches zero and instead diverges with larger and larger numbers with each iteration then a(n) = -1.
For larger values of n most starting values lead to a divergent series. The first such term is a(166). See the examples below. This reaches 888 after three iterations which is guaranteed to diverge due to the iterative cycle 888 -> 6464 -> 242424 -> 88888, and the series of 8's expands forever. All starting values examined up to 10^8 either reach zero else eventually contain three or more adjacent 8's and will therefore diverge. Unlike similar iterative sequences A329624 and A329198 there appears to be no fixed points or other cyclic behavior.
Up to n = 10^8 the largest number of iterative steps before reaching zero is 23. This is first seen for n = 3178 and for 18520 other starting values. Considering no larger number of steps was found, nor any during a brief test of random numbers larger than 10^8, it is possible this is the largest number of steps to reach zero for all starting values, with the exception of the repunits comprising k 1's which will take k steps to reach zero. A random number with a large number of digits will almost certainly diverge as it will result in 888, or similar divergent numbers, appearing within the iterative term at some step which, as shown above, will diverge.
There are numbers other than repunits of k 1's which take k steps to reach 0, e.g. n = 691...16 with m 1's where m is odd or 491...16 where m is even has a(n) = m + 17. - Robert Israel, Jul 01 2024

Examples

			a(1) = 1 as A330633(1) = 0, taking 1 iteration to reach 0.
a(11) = 2 as A330633(11) = 1 and A330633(1) = 0, taking 2 iterations to reach 0.
a(77) = 5 as A330633(77) = 49, A330633(49) = 36, A330633(36) = 18, A330633(18) = 8, A330633(8) = 0, taking 5 iterations to reach 0.
a(166) = -1 as A330633(166) = 636, A330633(636) = 1818, A330633(1818) = 888, which is guaranteed to diverge.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local L,i;
      L:= convert(n,base,10);
      if ormap(t -> L[t..t+2] = [8,8,8], [$1..nops(L)-2]) then return -1 fi;
      parse(cat(seq(L[i]*L[i+1],i=nops(L)-1 .. 1, -1)))
    end proc;
    for i from 1 to 9 do f(i):= 0 od:
    g:= proc(i) option remember; local v;
        v:= f(i);
        if v = -1 then -1
        else v:= procname(v);
             if v = -1 then -1 else 1 + v fi
        fi;
    end proc:
    g(0):= 0:
    map(g, [$0..200]); # Robert Israel, Jun 30 2024
  • Mathematica
    Array[If[#[[-1]] == 888, -1, Length@ # - 1] &@ NestWhileList[If[Or[# == 0, IntegerLength@ # == 1], 0, FromDigits[Join @@ IntegerDigits[Times @@ # & /@ Partition[IntegerDigits@ #, 2, 1]]]] &, #, And[# > 0, # != 888] &] &, 102, 0] (* Michael De Vlieger, Dec 23 2019 *)

A330159 The self-repeating start values of the iterative sequence A328680.

Original entry on oeis.org

91711, 91712, 141691, 151481, 161271, 271161, 1310812, 5020232, 10117443, 11552816, 14118522, 14149412, 14821815, 31410828, 35523710, 41113743, 46211402, 84404483, 91186117
Offset: 1

Views

Author

Scott R. Shannon, Dec 03 2019

Keywords

Comments

This sequences lists the self-repeating starting values n for the iterative sequence defined in A328680 up to starting values of n = 10^8. Each number in this sequence, when acting as the starting value for the A328680 iteration, will be the first number repeated in the iteration. Note that the other numbers appearing in the iterative sequence for a given start value n will in general NOT be other entries of this sequence as the iteration depends critically on the start value of n itself. As can be seen these numbers are quite rare, there being only 19 entries for n up to 100 million. It is unknown if this is a finite or infinite sequence.

Examples

			91711 is in the sequence as A040115(91711) = 8660, A053392(8660) = 14126, A053392(14126) = 5538, A053392(5538) = 10811, A053392(10811) = 1892, A053392(1892) = 91711, repeating the starting value 91711.
		

Crossrefs

A368940 Number of iterations before a repeated value, or -1 if this never occurs, when starting at k = 1 and repeating k = k*n if k does not contain any adjacent equal digits, else k = k with all adjacent equal digits replaced by a single copy of the same digit.

Original entry on oeis.org

1, 86, 338, 816, 2031, 1570, 2637, 2392, 4790, 3, 2, 15199, 21136, 8124, 12360, 18210, 101998, 41798, 15250, 135, 40063, 27298, 176470, 6553, 15757, 5031, 187645, 24050, 567055, 487, 141008, 71243, 341907, 154758, 38175, 150429, 84011, 106833, 351884, 1117, 391266, 324631, 1287699, 374743
Offset: 1

Views

Author

Scott R. Shannon and Eric Angelini, Jan 10 2024

Keywords

Comments

The largest term in the first 140 terms is a(127) = 121311726, which reaches a maximum value of 133672219006681613318653118648140533992241 at the 17276871st iteration, before repeating 2102014745703.

Examples

			a(2) = 86 as the iterations are : 1 -> 2 -> 4 -> 8 -> 16 -> 32 -> 64 -> 128 -> 256 -> 512 -> 1024 -> 2048 -> 4096 -> 8192 -> 16384 -> 32768 -> 65536 -> 6536 -> 13072 -> 26144 -> 2614 -> 5228 -> 528 -> 1056 -> 2112 -> 212 -> 424 -> 848 -> 1696 -> 3392 -> 392 -> 784 -> 1568 -> 3136 -> 6272 -> 12544 -> 1254 -> 2508 -> 5016 -> 10032 -> 1032 -> 2064 -> 4128 -> 8256 -> 16512 -> 33024 -> 3024 -> 6048 -> 12096 -> 24192 -> 48384 -> 96768 -> 193536 -> 387072 -> 774144 -> 7414 -> 14828 -> 29656 -> 59312 -> 118624 -> 18624 -> 37248 -> 74496 -> 7496 -> 14992 -> 1492 -> 2984 -> 5968 -> 11936 -> 1936 -> 3872 -> 7744 -> 74 -> 148 -> 296 -> 592 -> 1184 -> 184 -> 368 -> 736 -> 1472 -> 2944 -> 294 -> 588 -> 58 -> 116 -> 16, taking 86 steps to reach a repeated value.
a(10) = 3 as the iterations are : 1 -> 10 -> 100 -> 10, taking three steps to reach a repeated value.
a(11) = 2 as the iterations are : 1 -> 11 -> 1, taking two steps to reach a repeated value.
		

Crossrefs

Programs

  • Python
    from itertools import groupby
    def a(n):
        seen, k, c = set(), 1, 0
        while k not in seen:
            seen.add(k)
            c += 1
            s = str(k)
            t = "".join(k for k, g in groupby(s))
            k = k*n if s == t else int(t)
        return c
    print([a(n) for n in range(1, 45)]) # Michael S. Branicky, Jan 11 2024
Showing 1-8 of 8 results.