login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A230107 Define a sequence by b(1)=n, b(k+1)=b(k)+(sum of digits of b(k)); a(n) is the number of steps needed to reach a term in A004207, or a(n) = -1 if the sequence never joins A004207. 4
0, 0, -1, 0, 52, -1, 11, 0, -1, 51, 50, -1, 49, 10, -1, 0, 48, -1, 9, 50, -1, 49, 0, -1, 47, 48, -1, 0, 8, -1, 49, 46, -1, 47, 48, -1, 45, 0, -1, 7, 46, -1, 47, 6, -1, 45, 44, -1, 0, 46, -1, 5, 5, -1, 45, 44, -1, 43, 4, -1, 4, 0, -1, 4, 44, -1, 43, 3, -1, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,5

COMMENTS

Looking at b(k) mod 9 shows that a(n) = -1 whenever n is a multiple of 3 (since then the b sequence is disjoint from A004207).

Conjecture: the b sequence, for any starting value n, will eventually merge with one of A000004 (the zero sequence), A004207, A016052 or A016096.

LINKS

Table of n, a(n) for n=0..69.

Index entries for Colombian or self numbers and related sequences

EXAMPLE

For n=3, A016052 never meets A004207, so a(3) = -1.

For n=5, A007618 meets A004207 at the 53rd term, 620, so a(5) = 53.

MAPLE

read transforms; # to get digsum

M:=2000;

# f(s) returns the sequence k->k+digsum(k) starting at s

f:=proc(s) global M; option remember; local n, k, s1;

s1:=[s]; k:=s;

for n from 1 to M do  k:=k+digsum(k);

s1:=[op(s1), k]; od: end;

# g(s) returns (x, p), where x = first number in common between

# f(1) and f(s), and p is the position where it occurred.

# If f(1), f(s) are disjoint for M terms, returns (-1, -1)

S1:=convert(f(1), set):

g:=proc(s) global f, S1; local t1, p, S2, S3;

S2:=convert(f(s), set);

S3:= S1 intersect S2;

t1:=min(S3);

if (t1 = infinity) then RETURN(-1, -1); else

  member(t1, f(s), 'p'); RETURN(t1, p-1); fi;

end;

[seq(g(n)[2], n=1..20)];

PROG

(Haskell)

import Data.Maybe (fromMaybe)

a230107 = fromMaybe (-1) . f (10^5) 1 1 1 where

   f k i u j v | k <= 0    = Nothing

               | u < v     = f (k - 1) (i + 1) (a062028 u) j v

               | u > v     = f (k - 1) i u (j + 1) (a062028 v)

               | otherwise = Just j

CROSSREFS

Cf. A004207, A016052, A007618, A006507, A016096, A062028, A230299.

Sequence in context: A230299 A308235 A022079 * A275412 A100990 A298573

Adjacent sequences:  A230104 A230105 A230106 * A230108 A230109 A230110

KEYWORD

sign,base

AUTHOR

N. J. A. Sloane and Reinhard Zumkeller, Oct 15 2013; corrected Oct 20 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 16 16:18 EDT 2019. Contains 328101 sequences. (Running on oeis4.)