A109973 First repeating NA iterates. The NA (Noun-Adjective) function of a finite sequence s of nonnegative integers is the finite sequence 0a1b2c...mz, where a = #0's in s, b = #1's in s, ..., z = #m's in s, m = greatest term in s.
0, 1, 1, 2, 2, 3, 3, 2, 0, 1, 1, 3, 2, 1, 3, 3, 0, 1, 1, 3, 2, 1, 3, 3, 0, 1, 1, 3, 2, 2, 3, 3, 4, 1, 0, 1, 1, 4, 2, 2, 3, 2, 4, 2, 5, 1, 0, 1, 1, 5, 2, 2, 3, 2, 4, 1, 5, 2, 6, 1, 0, 1, 1, 5, 2, 4, 3, 1, 4, 1, 5, 1, 6, 2, 7, 1, 0, 1, 1, 6, 2, 4, 3, 1, 4, 1, 5, 1, 6, 1, 7, 2, 8, 1, 0, 1, 1, 7, 2, 4, 3, 1, 4, 1, 5
Offset: 1
Keywords
Programs
-
Mathematica
(* Program computes the NA segment starting with 0 *) nounAdjective[s_] := Flatten@Transpose@({#1, (Count[s, #1] &) /@ #1} &)[Range[0, Max[s]]]; NestList[nounAdjective[#1] &, nounAdjective[{0}], 7] (* Next program: the NA segment starting with 1 *) nounAdjective[s_] := Flatten@Transpose@({#1, (Count[s, #1] &) /@ #1} &)[Range[0, Max[s]]]; NestList[nounAdjective[#1] &, nounAdjective[{1}], 7] (* ...and so on. By Peter J. C. Moses, Jun 03 2011 *)
Comments