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

A053392 a(n) is the concatenation of the sums of every pair of consecutive digits of n (with a(n) = 0 for 0 <= n <= 9).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 210
Offset: 0

Views

Author

N. J. A. Sloane, Jan 07 2000

Keywords

Comments

Let the decimal expansion of n be d_1 d_2 ... d_k; a(n) is formed by concatenating the decimal numbers d_1+d_2, d_2+d_3, ..., d_{k-1}+d_k. - N. J. A. Sloane, Nov 01 2019
According to the Friedman link, 1496 is the smallest number whose trajectory increases without limit: see A328974
The Blomberg link asks whether a number n can have more than 10 predecessors, i.e. values of p such that a(p) = n. The answer is no, because there can be at most one predecessor ending with any given digit d. That can be proved by induction by observing that d and the last digit of n determine the last 1-or-2-digit sum in the concatenation of sums forming n, and hence the penultimate digit of p. That is either incompatible with the known value of n, or it tells us what the last digit of p' is, where p' = p with its last digit removed. We also know that p' is the predecessor of n' = n with its known last digit sum removed, and so we know there is at most one solution for p' by inductive hypothesis, and hence at most one solution for p. - David J. Seal, Nov 06 2019

Examples

			For n=10 we have 10 -> 1+0 = 1, hence a(10)=1;
987 -> 9+8.8+7 -> 17.15 -> 1715, so a(987)=1715.
		

References

  • Eric Angelini, Posting to Sequence Fans Mailing List, Oct 31 2019.

Crossrefs

Cf. A053393 (periodic points), A060630, A103117, A194429, A328973 (a(n)>n), A328974 (trajectory of 1496), A328975 (numbers that blow up).

Programs

  • Haskell
    a053392 :: Integer -> Integer
    a053392 n = if ys == "" then 0 else read ys where
       ys = foldl (++) "" $ map show $ zipWith (+) (tail ds) ds
       ds = (map (read . return) . show) n
    -- Reinhard Zumkeller, Nov 26 2013
    
  • Maple
    read("transforms") :
    A053392 := proc(n)
        if n < 10 then
            0;
        else
            dgs := convert(n,base,10) ;
            dgsL := [op(1,dgs)+op(2,dgs)] ;
            for i from 3 to nops(dgs) do
                dgsL := [op(i,dgs)+op(i-1,dgs),op(dgsL)] ;
            end do:
            digcatL(dgsL) ;
        end if;
    end proc: # R. J. Mathar, Nov 26 2019
  • Mathematica
    a[n_] := Total /@ Transpose[{Most[id = IntegerDigits[n]], Rest[id]}] // IntegerDigits // Flatten // FromDigits; Table[a[n], {n, 0, 119}] (* Jean-François Alcover, Apr 05 2013 *)
  • PARI
    apply( {A053392(n)=if(n>9,n=digits(n);eval(concat(apply(i->Str(n[i-1]+n[i]),[2..#n]))))}, [1..199]) \\ M. F. Hasler, Nov 01 2019
    
  • Python
    def A053392(n):
        if n < 10: return 0
        d = list(map(int, str(n)))
        return int("".join(str(d[i] + d[i+1]) for i in range(len(d)-1)))
    print([A053392(n) for n in range(120)]) # Michael S. Branicky, Sep 04 2021

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

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

Showing 1-3 of 3 results.