cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A098962 Smallest sequence such that over all terms each prime p occurs exactly p times as prime factor; a(1)=1.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 11, 13, 15, 17, 19, 23, 25, 29, 31, 35, 37, 41, 43, 47, 49, 53, 59, 61, 67, 71, 73, 77, 79, 83, 89, 91, 97, 101, 103, 107, 109, 113, 119, 121, 127, 131, 137, 139, 143, 149, 151, 157, 163, 167, 169, 173, 179, 181, 187, 191, 193, 197, 199, 209, 211
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 22 2004

Keywords

Comments

A000040 is a subsequence.
A099619 gives k such that a(k) = n-th prime; A099620 gives the greatest term divisible by the n-th prime.
A001222(a(n)) <= 2.

Examples

			p=2: a(2)=2, a(5)=6=2*3: 4=2*2 is missing, otherwise 2 would occur more than 2 times, there are no more even terms greater than 6;
p=3: a(3)=3, a(5)=6=2*3, a(9)=15=3*5: 9=3*3 is missing, otherwise 3 would occur more than 3 times, there are no more multiples of 3 greater than 15;
p=5: a(4)=5, a(9)=15=3*5, a(13)=25=5*5, a(16)=35=5*7: no more multiples of 5 greater than 35;
p=7: a(6)=7, a(16)=35=5*7, a(21)=49=7*7, a(28)=77=7*11, a(32)=91=7*13, a(39)=119=7*17: no more multiples of 7 greater than 119.
- _Reinhard Zumkeller_, Feb 17 2013
		

Crossrefs

Cf. A020639, A008578, A005145, subsequence of A037143.

Programs

  • Haskell
    import Data.List (delete)
    a098962 n = a098962_list !! (n-1)
    a098962_list = 1 : f [2..] (tail a175944_list) where
       f xs'@(x:xs) ps'@(p:ps)
         | a010051 x == 1    = x : f xs (delete x ps')
         | u == q && v == q' = x : f xs' zs
         | otherwise         = f xs ps'
         where q = a020639 x; q' = div x q
               (us, u:us') = span (< q) ps'
               (vs, v:vs') = span (< q') us'
               zs@(z:_) = us ++ vs ++ vs'
               xs' = if z == p then xs else filter ((> 0) . (`mod` p)) xs
    -- Reinhard Zumkeller, Feb 17 2013

Formula

#{(n,k): A027746(a(n),k)=p, 1<=k<=A001222(a(n))} = p for all primes p. - Reinhard Zumkeller, Feb 17 2013