A140460 a(0) = 2; thereafter a(n) = smallest integer not a multiple of an earlier terms nor a sum of two earlier terms.
2, 3, 7, 11, 17, 23, 29, 37, 41, 47, 53, 59, 65, 71, 79, 83, 89, 95, 101, 107, 113, 125, 131, 137, 149, 155, 163, 167, 173, 179, 191, 197, 211, 215, 223, 227, 233, 239, 247, 251, 257, 263, 269, 277, 281, 293, 305, 311, 317, 331, 335
Offset: 0
Links
- Nathaniel Johnston, Table of n, a(n) for n = 0..10000
Programs
-
C
#include
#include void sieve(){ const int first = 2; const int max = 10000; bool member[max]; for(int i = first; i < max; ++i){ member[i] = true; } for(int i = first; i < max; ++i){ if(member[i]){ for(int x = i + i; x < max; x += i){ member[x] = false; } for(int j = first; j < i; ++j){ if(member[j] && i + j < max){ member[i + j] = false; } } } } int num = 0; for(int i = first; i < max; ++i){ if(member[i]){ printf("%i, ", i); num += 1; } } printf(" num = %i ", num); } -
Mathematica
s={2};Do[m=2;Until[Total[Boole[Divisible[m,s]]]==0&&!MemberQ[Total/@Subsets[s,{2}],m],m++];AppendTo[s,m],{n,50}];s (* James C. McMahon, Jul 09 2025 *)
Comments