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.

Showing 1-3 of 3 results.

A286378 Restricted growth sequence computed for Stern-polynomial related filter-sequence A278243.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 4, 7, 3, 8, 5, 9, 2, 10, 6, 11, 4, 12, 7, 13, 3, 13, 8, 14, 5, 15, 9, 16, 2, 17, 10, 18, 6, 19, 11, 20, 4, 21, 12, 22, 7, 23, 13, 24, 3, 24, 13, 25, 8, 26, 14, 27, 5, 28, 15, 29, 9, 30, 16, 31, 2, 32, 17, 33, 10, 34, 18, 35, 6, 36, 19, 37, 11, 38, 20, 39, 4, 40, 21, 41, 12, 42, 22, 43, 7, 44, 23, 45, 13, 46, 24, 47, 3, 47, 24, 48
Offset: 0

Views

Author

Antti Karttunen, May 09 2017

Keywords

Comments

Construction: we start with a(0)=1 for A278243(0)=1, and then after, for n > 0, we use the least unused natural number k for a(n) if A278243(n) has not been encountered before, otherwise [whenever A278243(n) = A278243(m), for some m < n], we set a(n) = a(m).
When filtering sequences (by equivalence class partitioning), this sequence (with its modestly sized terms) can be used instead of A278243, because for all i, j it holds that: a(i) = a(j) <=> A278243(i) = A278243(j).
For example, for all i, j: a(i) = a(j) => A002487(i) = A002487(j).
For pairs of distinct primes p, q for which a(p) = a(q) see comments in A317945. - Antti Karttunen, Aug 12 2018

Examples

			For n=1, A278243(1) = 2, which has not been encountered before, thus we allot for a(1) the least so far unused number, which is 2, thus a(1) = 2.
For n=2, A278243(2) = 2, which was already encountered as A278243(1), thus we set a(2) = a(1) = 2.
For n=3, A278243(3) = 6, which has not been encountered before, thus we allot for a(3) the least so far unused number, which is 3, thus a(3) = 3.
For n=23, A278243(23) = 2520, which has not been encountered before, thus we allot for a(23) the least so far unused number, which is 13, thus a(23) = 3.
For n=25, A278243(25) = 2520, which was already encountered at n=23, thus we set a(25) = a(23) = 13.
		

Crossrefs

Cf. also A101296, A286603, A286605, A286610, A286619, A286621, A286622, A286626 for similarly constructed sequences.
Differs from A103391(1+n) for the first time at n=25, where a(25)=13, while A103391(26) = 14.

Programs

  • Mathematica
    a[n_] := a[n] = Which[n < 2, n + 1, EvenQ@ n, Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e > 0 :> {Prime[PrimePi@ p + 1], e}] - Boole[# == 1] &@ a[n/2], True, a[#] a[# + 1] &[(n - 1)/2]]; With[{nn = 100}, Function[s, Table[Position[Keys@ s, k_ /; MemberQ[k, n]][[1, 1]], {n, nn}]]@ Map[#1 -> #2 & @@ # &, Transpose@ {Values@ #, Keys@ #}] &@ PositionIndex@ Table[Times @@ MapIndexed[Prime[First@#2]^#1 &, Sort[FactorInteger[#][[All, -1]], Greater]] - Boole[# == 1] &@ a@ n, {n, 0, nn}]] (* Michael De Vlieger, May 12 2017 *)
  • PARI
    up_to = 65537;
    rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences,invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences,invec[i],i); outvec[i] = u; u++ )); outvec; };
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ From A046523
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961
    A260443(n) = if(n<2, n+1, if(n%2, A260443(n\2)*A260443(n\2+1), A003961(A260443(n\2))));
    A278243(n) = A046523(A260443(n));
    v286378 = rgs_transform(vector(up_to+1,n,A278243(n-1)));
    A286378(n) = v286378[1+n];

A286374 a(n) = A278222(n^2).

Original entry on oeis.org

1, 2, 2, 6, 2, 12, 6, 12, 2, 30, 12, 48, 6, 210, 12, 24, 2, 30, 30, 420, 12, 360, 48, 30, 6, 120, 210, 1260, 12, 420, 24, 48, 2, 30, 30, 420, 30, 4620, 420, 480, 12, 420, 360, 1080, 48, 960, 30, 210, 6, 420, 120, 2310, 210, 3360, 1260, 1680, 12, 1260, 420, 6300, 24, 840, 48, 96, 2, 30, 30, 420, 30, 4620, 420, 2520, 30, 4620, 4620, 6720, 420, 9240, 480, 180
Offset: 0

Views

Author

Antti Karttunen, May 09 2017

Keywords

Crossrefs

Cf. A159918 (one of the matched sequences).

Programs

  • Python
    from sympy import prime, factorint
    import math
    def A(n): return n - 2**int(math.floor(math.log(n, 2)))
    def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
    def a005940(n): return b(n - 1)
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def a278222(n): return a046523(a005940(n + 1))
    def a(n): return a278222(n**2) # Indranil Ghosh, May 09 2017
  • Scheme
    (define (A286374 n) (A278222 (* n n)))
    

Formula

a(n) = A278222(A000290(n)) = A278222(n^2).

A286387 a(n) = A002487(n^2).

Original entry on oeis.org

0, 1, 1, 4, 1, 7, 4, 9, 1, 14, 7, 13, 4, 29, 9, 16, 1, 23, 14, 43, 7, 36, 13, 29, 4, 43, 29, 64, 9, 67, 16, 25, 1, 34, 23, 89, 14, 115, 43, 46, 7, 85, 36, 79, 13, 46, 29, 79, 4, 97, 43, 142, 29, 89, 64, 91, 9, 136, 67, 157, 16, 121, 25, 36, 1, 47, 34, 151, 23, 236, 89, 157, 14, 211, 115, 104, 43, 225, 46, 109, 7, 162, 85, 235, 36, 139, 79, 174, 13, 101, 46
Offset: 0

Views

Author

Antti Karttunen, May 09 2017

Keywords

Comments

Conjecture: For all i >= 0, j >= 0: A103391(1+i) = A103391(1+j) => a(i) = a(j). This would be an implication of observation made at A286377, which has been checked up to n=2048. See also A286378.

Crossrefs

Programs

  • Python
    from functools import reduce
    def A286387(n): return sum(reduce(lambda x,y:(x[0],x[0]+x[1]) if int(y) else (x[0]+x[1],x[1]),bin(n**2)[-1:2:-1],(1,0))) if n else 0 # Chai Wah Wu, May 18 2023
  • Scheme
    (define (A286387 n) (A002487 (* n n)))
    

Formula

a(n) = A002487(A000290(n)) = A002487(n^2).
Showing 1-3 of 3 results.