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

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A248820 a(1)=0; a(n+1) = a(n) - gpf(n) if a(n) >= gpf(n), otherwise a(n+1) = a(n) + lpf(n), where gpf(n) is the greatest prime dividing n (A006530) and lpf(n) is the least prime dividing n (A020639). 1
 0, 1, 3, 0, 2, 7, 4, 11, 9, 6, 1, 12, 9, 22, 15, 10, 8, 25, 22, 3, 5, 8, 10, 33, 30, 25, 12, 9, 2, 31, 26, 57, 55, 44, 27, 20, 17, 54, 35, 22, 17, 58, 51, 8, 10, 5, 7, 54, 51, 44, 39, 22, 9, 62, 59, 48, 41, 22, 24, 83, 78, 17, 19, 12, 10, 15, 4, 71, 54, 31, 24 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,3 COMMENTS By convention, gpf(1) = lpf(1) = 1. a(n) = 0 for n = 1, 4, 154, 186, 287, 641, 903, 980, 1626, 1847, 3761, 5024, 11563, 20471, 23046, 31082, 31219, 34866, 40339, ... LINKS Michel Lagneau, Table of n, a(n) for n = 1..10000 EXAMPLE a(1) = 0; a(2) = a(1) + lpf(1) = 0 + 1 = 1 because a(1) < gpf(1); a(3) = a(2) + lpf(2) = 1 + 2 = 3 because a(2) < gpf(2); a(4) = a(3) - gpf(3) = 3 - 3 = 0 because a(3) = gpf(3); a(5) = a(4) + gpf(4) = 0 + 2 = 2 because a(4) < gpf(4); a(6) = a(5) + gpf(5) = 2 + 5 = 7 because a(5) < gpf(5); a(7) = a(6) - gpf(6) = 7 - 3 = 4 because a(6) > gpf(6). MAPLE with(numtheory):a1:=1:printf(`%d, `, 0):printf(`%d, `, 1): for n from 2 to 200 do :   x:=factorset(n):n1:=nops(x):d:=x[n1]:    if a1-d<0    then    a1:=a1+x[1]:    else    a1:=a1-d:    fi:    printf(`%d, `, a1): od: CROSSREFS Cf. A006530, A020639. Sequence in context: A209129 A282694 A011075 * A085550 A223139 A302278 Adjacent sequences:  A248817 A248818 A248819 * A248821 A248822 A248823 KEYWORD nonn AUTHOR Michel Lagneau, Oct 15 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.

Last modified August 13 04:54 EDT 2020. Contains 336442 sequences. (Running on oeis4.)