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-2 of 2 results.

A306264 a(n) = 1 + d*a(n/d); a(1)=0. If n has only one prime divisor, then d=n, otherwise d is the greatest proper unitary divisor of n.

Original entry on oeis.org

0, 1, 1, 1, 1, 4, 1, 1, 1, 6, 1, 5, 1, 8, 6, 1, 1, 10, 1, 6, 8, 12, 1, 9, 1, 14, 1, 8, 1, 16, 1, 1, 12, 18, 8, 10, 1, 20, 14, 9, 1, 22, 1, 12, 10, 24, 1, 17, 1, 26, 18, 14, 1, 28, 12, 9, 20, 30, 1, 21, 1, 32, 10, 1, 14, 34, 1, 18, 24, 36, 1, 10, 1, 38, 26, 20, 12, 40, 1, 17
Offset: 1

Views

Author

David James Sycamore, Feb 01 2019

Keywords

Comments

Name related to recursive formula of A006022.
a(n) = 1 if and only if n is a prime power; p^t; t >= 1.
The sequence of indices k on which a(k) is a record (1,2,6,10,14,18,22,26,30,...), appears to be A111284.

Examples

			a(8) = a(25) = 1 because 8 and 25 are prime powers.
a(30) = 16 because 15 is the greatest proper unitary divisor of 30, so a(30) = 1 + 15*a(2) = 1 + 15 = 16.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := If[PrimePowerQ[n], n,
      SelectFirst[Transpose@
        {Reverse@ #[[-Ceiling[Length[#]/2] ;; -2]],
          #[[2 ;; Ceiling[Length[#]/2]]]} &@ Divisors[n],
        CoprimeQ @@ # &][[1]] ]; f[1] = 1;
    a[n_] := 1 + #*a[n/#] &[f[n]]; a[1] = 0;
    Array[a, 120] (* Michael De Vlieger, Jun 24 2025 *)
  • PARI
    d(n) = if (omega(n) == 1, n, my(v=select(x->(gcd(x, n/x)==1), divisors(n))); v[#v-1]);
    lista(nn) = {va = vector(nn); va[1] = 0; for (n=2, nn, dn = d(n); va[n] = 1 + dn*va[n/dn];); va;} \\ Michel Marcus, Feb 10 2019
    
  • PARI
    A324388(n) = if(1>=omega(n),n,fordiv(n,d,if((d>1)&&(1==gcd(d,n/d)),return(n/d))));
    A306264(n) = if(1==n,0,my(d=A324388(n)); 1+(d*A306264(n/d))); \\ Antti Karttunen, Feb 28 2019

Formula

a(1) = 0; for n > 1, a(n) = 1 + (A324388(n) * a(n/A324388(n))). - Antti Karttunen, Feb 28 2019

A346596 Let m = A344005(n) = smallest m such that n divides m*(m+1); a(n) = max(gcd(n,m), gcd(n,m+1)).

Original entry on oeis.org

1, 2, 3, 4, 5, 3, 7, 8, 9, 5, 11, 4, 13, 7, 5, 16, 17, 9, 19, 5, 7, 11, 23, 8, 25, 13, 27, 7, 29, 6, 31, 32, 11, 17, 7, 9, 37, 19, 13, 8, 41, 7, 43, 11, 9, 23, 47, 16, 49, 25, 17, 13, 53, 27, 11, 8, 19, 29, 59, 15, 61, 31, 9, 64, 13, 11, 67, 17, 23, 14, 71, 9, 73, 37, 25, 19
Offset: 1

Views

Author

Keywords

Comments

This is the maximum of A345992 and A345993.

Crossrefs

Programs

  • PARI
    f(n) = my(m=1); while ((m*(m+1)) % n, m++); m; \\ A344005
    a(n) = my(m=f(n)); max(gcd(n,m), gcd(n,m+1)); \\ Michel Marcus, Aug 06 2021
    (Python 3.8+)
    from math import gcd, prod
    from itertools import combinations
    from sympy import factorint
    from sympy.ntheory.modular import crt
    def A346596(n):
        if n == 1:
            return 1
        plist = tuple(p**q for p, q in factorint(n).items())
        return n if len(plist) == 1 else max(gcd(n,s:=int(min(min(crt((m, n//m), (0, -1))[0], crt((n//m, m), (0, -1))[0]) for m in (prod(d) for l in range(1, len(plist)//2+1) for d in combinations(plist, l))))),gcd(n,s+1)) # Chai Wah Wu, Jun 17 2022
Showing 1-2 of 2 results.