[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Revision History for A248737 (Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
a(0) = 0; a(n) = smallest k such that gcd(a(n-k), n) is not 1.
(history; published version)
#12 by Reinhard Zumkeller at Fri Apr 17 16:04:09 EDT 2015
STATUS

editing

approved

#11 by Reinhard Zumkeller at Fri Apr 17 13:57:16 EDT 2015
COMMENTS

A257173(n) = smallest number m such that a(m) = n. - Reinhard Zumkeller, Apr 17 2015

PROG

(Haskell)

import Data.List (findIndex); import Data.Maybe (fromMaybe)

a248737 n = a248737_list !! n

a248737_list = 0 : f 1 [0] where

f x ys = y : f (x + 1) (y : ys) where

y = (+ 1) $ fromMaybe (x - 1) $ findIndex (\z -> gcd z x /= 1) ys

-- Reinhard Zumkeller, Apr 17 2015

CROSSREFS

Cf. A257173.

STATUS

approved

editing

#10 by Alois P. Heinz at Sat Oct 18 13:43:31 EDT 2014
STATUS

reviewed

approved

#9 by Joerg Arndt at Fri Oct 17 13:07:39 EDT 2014
STATUS

proposed

reviewed

#8 by Michel Marcus at Fri Oct 17 12:35:49 EDT 2014
STATUS

editing

proposed

#7 by Michel Marcus at Fri Oct 17 12:35:25 EDT 2014
DATA

0, 1, 2, 3, 2, 5, 2, 7, 2, 6, 1, 11, 3, 13, 5, 1, 7, 17, 6, 19, 2, 3, 2, 23, 2, 11, 2, 6, 1, 29, 3, 31, 5, 3, 7, 1, 3, 37, 11, 3, 8, 41, 2, 43, 2, 6, 1, 47, 3, 15, 1, 2, 1, 53, 3, 6, 1, 2, 1, 59, 3, 61, 5, 3, 7, 3, 1, 67, 11, 4, 1, 71, 3, 73, 5, 1, 7, 1, 6, 79

COMMENTS

If p is prime, a(p) = p.

PROG

(PARI) findk(va, n) = {k = 1; while (gcd(va[n-k], n) == 1, k++; if (k==n, break)); k; }

lista(nn) = {va = vector(nn); va[1] = 1; print1(0, ", ", va[1], ", "); for (n=2, nn, va[n] = findk(va, n); print1(va[n], ", "); ); } \\ Michel Marcus, Oct 17 2014

STATUS

approved

editing

Discussion
Fri Oct 17
12:35
Michel Marcus: terms already in b-file so no extension
#6 by N. J. A. Sloane at Thu Oct 16 19:11:38 EDT 2014
STATUS

editing

approved

#5 by Nathaniel Shar at Mon Oct 13 12:27:37 EDT 2014
LINKS

Nathaniel Shar, <a href="/A248737/b248737.txt">Table of n, a(n) for n = 0..10000</a>

#4 by Nathaniel Shar at Mon Oct 13 12:26:49 EDT 2014
DATA

0, 1, 2, 3, 2, 5, 2, 7, 2, 6, 1, 11, 3, 13, 5, 1, 7, 17, 6, 19, 2, 3, 2, 23, 2, 11, 2, 6, 1, 29, 3, 31, 5, 3, 7, 1, 3, 37, 12, 11, 3, 2, 8, 41, 2, 43, 2, 6, 1, 47, 3, 15, 1, 2, 1, 53, 3, 6, 1, 2, 1, 59, 3

#3 by Nathaniel Shar at Mon Oct 13 12:01:54 EDT 2014
NAME

a(0) = 0; a(n) = smallest k such that gcd(a(n-k), n) != is not 1.

COMMENTS

If p is prime, a(p) = p

EXAMPLE

a(9) = 6 because a(8) = 2, a(7) = 7, a(6) = 2, a(5) = 5, a(4) = 2 are all relatively prime to 9, but a(3) = 3 is not.