A081806 Least positive number that can be written using prime factors of n (with repetition) and the operations add and subtract.
2, 3, 4, 5, 1, 7, 2, 6, 3, 11, 1, 13, 5, 2, 4, 17, 2, 19, 1, 4, 9, 23, 1, 10, 11, 3, 3, 29, 4, 31, 2, 8, 15, 2, 2, 37, 17, 10, 1, 41, 2, 43, 7, 1, 21, 47, 1, 14, 2, 14, 9, 53, 1, 6, 1, 16, 27, 59, 2, 61, 29, 1, 4, 8, 6, 67, 13, 20, 4, 71, 2, 73, 35, 3, 15, 4, 8, 79, 1, 6, 39, 83, 4, 12, 41, 26, 5
Offset: 2
Keywords
Examples
24=2*2*2*3 -> a(24) = 2-2-2+3 = 1; 30=2*3*5 -> a(30) = 2-3+5 = 4, as -2-3-5<1, -2-3+5<1, -2+3-5<1, -2+3+5>4, 2-3-5<1, 2+3-5<1 and 2+3+5>4.
Links
- Donovan Johnson, Table of n, a(n) for n = 2..1000
Programs
-
PARI
v=vector(9); for(n=2, 1000, c=0; f=factorint(n); for(j=1, omega(n), for(h=1, f[j,2], c++; v[c]=f[j,1])); nn=997; for(j=0, 2^c-1, s=0; for(h=0, c-1, if(bittest(j,h)==0, s=s-v[h+1], s=s+v[h+1])); if(s>0, if(s
Donovan Johnson, Sep 14 2013 */
Comments