A076077 Group the natural numbers so that the n-th group contains n numbers, the k-th number in a group is a multiple of k and the sum of the group is prime: (2), (1, 4), (3, 8, 6), (5, 10, 12, 16), (7, 14, 9, 24, 25), ...
2, 1, 4, 3, 8, 6, 5, 10, 12, 16, 7, 14, 9, 24, 25, 11, 18, 15, 20, 45, 30, 13, 22, 21, 28, 35, 36, 42, 17, 26, 27, 32, 40, 48, 49, 72, 19, 34, 33, 44, 50, 54, 56, 80, 63, 23, 38, 39, 52, 55, 60, 70, 64, 90, 110, 29, 46, 51, 68, 65, 66, 77, 88, 81, 120, 132, 31, 58, 57, 76, 75
Offset: 1
Examples
2, 1, 4, 3, 8, 6, 5, 10, 12, 16, 7, 14, 9, 24, 25, 11, 18, 15, 20, 45, 30, 13, 22, 21, 28, 35, 36, 42, 17, 26, 27, 32, 40, 48, 49, 72, 19, 34, 33, 44, 50, 54, 56, 80, 63, 23, 38, 39, 52, 55, 60, 70, 64, 90,110, 29, 46, 51, 68, 65, 66, 77, 88, 81,120,132,
Programs
-
Maple
A076077 := proc(n,k) option remember ; local a,prev,nprev,kprev,psum; for a from k by k do prev := false ; for nprev from 1 to n-1 do for kprev from 1 to nprev do if procname(nprev,kprev) = a then prev := true ; end if; end do: end do: psum :=0 ; for kprev from 1 to k-1 do psum := psum+procname(n,kprev) ; if procname(n,kprev) = a then prev := true ; end if; end do: if not prev then if k = n-1 then if igcd(a + psum,n) = 1 then return a; end if; elif k = n then if isprime(a + psum) then return a; end if; else return a; end if; end if; end do: end proc: # R. J. Mathar, Jul 08 2025
Extensions
More terms from David Wasserman, Mar 24 2005
Comments