login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A092383 Sum of digits of n if n odd, else sum of digits of 2n. 2

%I #6 Jul 25 2015 01:02:10

%S 0,1,4,3,8,5,3,7,7,9,2,2,6,4,10,6,5,8,9,10,4,3,8,5,12,7,7,9,11,11,6,4,

%T 10,6,14,8,9,10,13,12,8,5,12,7,16,9,11,11,15,13,1,6,5,8,9,10,4,12,8,

%U 14,3,7,7,9,11,11,6,13,10,15,5,8,9,10,13,12,8,14,12,16,7,9,11,11,15,13,10

%N Sum of digits of n if n odd, else sum of digits of 2n.

%C Inspired by Luhn algorithm for validating credit cards.

%F a(n) = sum of digits(if n odd then n else 2n).

%e a(11) = 2 = 1 + 1 (1 and 1 are the digits in 11).

%e a(12) = 6 = 2 + 4 (2 and 4 are the digits in 24 = 2 * 12).

%t f[n_] := Plus @@ IntegerDigits[ If[ OddQ[n], n, 2n]]; Table[ f[n], {n, 0, 90}] (* _Robert G. Wilson v_, Mar 24 2004 *)

%Y Cf. A092384, A093150.

%K easy,nonn,base

%O 0,3

%A Semaphore Corporation (help(AT)semaphorecorp.com), Mar 20 2004

%E Corrected and extended by _Ray Chandler_, Mar 21 2004

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 09:24 EDT 2024. Contains 371967 sequences. (Running on oeis4.)