login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A252022 Lexicographically earliest permutation of the positive integers, such that no carry occurs when adjacent terms are added in decimal representation. 7
1, 2, 3, 4, 5, 10, 6, 11, 7, 12, 13, 14, 15, 20, 8, 21, 16, 22, 17, 30, 9, 40, 18, 31, 23, 24, 25, 32, 26, 33, 34, 35, 41, 27, 42, 36, 43, 44, 45, 50, 19, 60, 28, 51, 37, 52, 46, 53, 100, 29, 70, 101, 38, 61, 102, 47, 110, 39, 120, 48, 111, 54, 103, 55, 104 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

a(n+1) = smallest number, not occurring earlier, such that no carry occurs when adding it to a(n) in decimal arithmetic.

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000

Eric Weisstein's World of Mathematics, Carry

Wikipedia, Carry (arithmetic)

Index entries for sequences that are permutations of the natural numbers

PROG

(Haskell)

import Data.List (delete)

a252022 n = a252022_list !! (n-1)

a252022_list = 1 : f [1] (drop 2 a031298_tabf) where

   f xs zss = g zss where

     g (ds:dss) = if all (<= 9) $ zipWith (+) xs ds

       then (foldr (\d v -> 10 * v + d) 0 ds) : f ds (delete ds zss)

       else g dss

(Python)

A252022_list, l, s, b = [1], [1], 2, set()

for _ in range(10**3):

....i = s

....while True:

........if i not in b:

............li = [int(d) for d in str(i)[::-1]]

............for x, y in zip(li, l):

................if x+y > 9:

....................break

............else:

................l = li

................b.add(i)

................A252022_list.append(i)

................while s in b:

....................b.remove(s)

....................s += 1

................break

........i += 1 # Chai Wah Wu, Dec 14 2014

CROSSREFS

Cf. A252001 (carries required); A252023 (inverse), A252079 (fixed points), A251984, A167831.

Cf. A262604 (first differences).

Sequence in context: A067034 A302840 A320870 * A039697 A319131 A231566

Adjacent sequences:  A252019 A252020 A252021 * A252023 A252024 A252025

KEYWORD

nonn,base

AUTHOR

Reinhard Zumkeller, Dec 12 2014

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 November 27 06:10 EST 2021. Contains 349363 sequences. (Running on oeis4.)