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.

A252895 Numbers with an odd number of square divisors.

This page as a plain text file.
%I A252895 #87 Jun 20 2023 15:00:16
%S A252895 1,2,3,5,6,7,10,11,13,14,15,16,17,19,21,22,23,26,29,30,31,32,33,34,35,
%T A252895 37,38,39,41,42,43,46,47,48,51,53,55,57,58,59,61,62,65,66,67,69,70,71,
%U A252895 73,74,77,78,79,80,81,82,83,85,86,87,89,91,93,94,95,96,97
%N A252895 Numbers with an odd number of square divisors.
%C A252895 Open lockers in the locker problem where the student numbers are the set of perfect squares.
%C A252895 The locker problem is a classic mathematical problem. Imagine a row containing an infinite number of lockers numbered from one to infinity. Also imagine an infinite number of students numbered from one to infinity. All of the lockers begin closed. The first student opens every locker that is a multiple of one, which is every locker. The second student closes every locker that is a multiple of two, so all of the even-numbered lockers are closed. The third student opens or closes every locker that is a multiple of three. This process continues for all of the students. [This is sometimes called the light switch problem - see A360845.]
%C A252895 A variant on the locker problem is when not all student numbers are considered; in the case of this sequence, only the square-numbered students open and close lockers. The sequence here is a list of the open lockers after all of the students have gone.
%C A252895 n is in the sequence if and only if it is the product of a squarefree number (A005117) and a fourth power (A000583). - _Robert Israel_, Apr 07 2015
%C A252895 Let D be the multiset containing d0(k), the divisor counting function, for each divisor k of n. n is in the sequence if and only if D admits a partition into two parts A and B such that the sum of the elements of A is exactly one more or less than the sum of the elements of B. For example, if n = 80, we have D = {1, 2, 2, 3, 4, 4, 5, 6, 8, 10}, and A = {1, 2, 3, 4, 4, 8} and B = {2, 5, 6, 10}. The sum of A is 22, and the sum of B is 23. - _Griffin N. Macris_, Oct 10 2016
%C A252895 From _Amiram Eldar_, Jul 07 2020: (Start)
%C A252895 Numbers k such that the largest square dividing k (A008833) is a fourth power.
%C A252895 The asymptotic density of this sequence is Pi^2/15 = A182448 = 0.657973... (Cesàro, 1885). (End)
%C A252895 Closed under the binary operation A059897(.,.), forming a subgroup of the positive integers under A059897. - _Peter Munn_, Aug 01 2020
%H A252895 Reinhard Zumkeller, <a href="/A252895/b252895.txt">Table of n, a(n) for n = 1..10000</a>
%H A252895 Ernest Cesàro, <a href="https://doi.org/10.1007/BF02420801">Le plus grand diviseur carré</a>, Annali di Matematica Pura ed Applicata, Vol. 13, No. 1 (1885), pp. 251-268, <a href="https://iris.univ-lille.fr/handle/1908/1932">entire volume</a>.
%H A252895 K. A. P. Dagal, <a href="http://arxiv.org/abs/1307.6455">Generalized Locker Problem</a>, arXiv:1307.6455 [math.NT], 2013.
%H A252895 B. Torrence and S. Wagon, <a href="https://cms.math.ca/crux/v33/n4/page232-236.pdf">The Locker Problem</a>, Crux Mathematicorum, 2007, 33(4), 232-236.
%e A252895 The set of divisors of 6 is {1,2,3,6}, which contains only one perfect square: 1; therefore 6 is a term.
%e A252895 The set of divisors of 16 is {1,2,4,8,16}, which contains three perfect squares: 1, 4, and 16; therefore 16 is a term.
%e A252895 The set of divisors of 4 is {1,2,4}, which contains two perfect squares: 1 and 4; therefore 4 is not a term.
%p A252895 N:= 1000: # to get all terms <= N
%p A252895 S:= select(numtheory:-issqrfree, {$1..N}):
%p A252895 map(s -> seq(s*i^4, i = 1 .. floor((N/s)^(1/4))), S);
%p A252895 # if using Maple 11 or earlier, uncomment the next line
%p A252895 # sort(convert(%,list)); # _Robert Israel_, Apr 07 2015
%t A252895 Position[Length@ Select[Divisors@ #, IntegerQ@ Sqrt@ # &] & /@ Range@ 70, _Integer?OddQ] // Flatten (* _Michael De Vlieger_, Mar 23 2015 *)
%t A252895 a[n_] := DivisorSigma[0, Total[EulerPhi/@Select[Sqrt[Divisors[n]], IntegerQ]]]; Flatten[Position[a/@Range@100,_?OddQ]] (* _Ivan N. Ianakiev_, Apr 07 2015 *)
%t A252895 Select[Range@ 100, OddQ@ Length@ DeleteCases[Divisors@ #, k_ /; ! IntegerQ@ Sqrt@ k] &] (* _Michael De Vlieger_, Oct 10 2016 *)
%o A252895 (C++)
%o A252895 #include <iostream>
%o A252895 using namespace std;
%o A252895 int main()
%o A252895 {
%o A252895 const int one_k = 1000;
%o A252895 //all numbers in sequence up to one_k are given
%o A252895 int lockers [one_k] = {};
%o A252895 int A = 0;
%o A252895 while (A < one_k) {
%o A252895   lockers [A] = A+1;
%o A252895   A = A + 1;
%o A252895 }
%o A252895 int B = 1;
%o A252895 while ( ((B) * (B)) <= one_k) {
%o A252895   int C = ((B) * (B));
%o A252895   int D = one_k/C;
%o A252895   int E = 1;
%o A252895   while (E <= D) {
%o A252895     lockers [(C*E)-1] = -1 * lockers [(C*E)-1];
%o A252895     E = E + 1;
%o A252895   }
%o A252895   B = B + 1;
%o A252895 }
%o A252895 int F = 0;
%o A252895 while (F < one_k) {
%o A252895   if (lockers [F] < 0) {
%o A252895     cout << (-1 * lockers [F]) << endl;
%o A252895   }
%o A252895 F = F + 1;
%o A252895 }
%o A252895 return 0;
%o A252895 } // _Walker Dewey Anderson_, Mar 22 2015
%o A252895 (PARI) isok(n) = sumdiv(n, d, issquare(d)) % 2; \\ _Michel Marcus_, Mar 22 2015
%o A252895 (Sage) [n for n in [1..200] if len([x for x in divisors(n) if is_square(x)])%2==1] # _Tom Edgar_, Mar 22 2015
%o A252895 (Haskell)
%o A252895 a252895 n = a252895_list !! (n-1)
%o A252895 a252895_list = filter (odd . a046951) [1..]
%o A252895 -- _Reinhard Zumkeller_, Apr 06 2015
%Y A252895 Cf. A000290, A000583, A005117, A008833, A046951, A182448, A252849, A360845.
%Y A252895 Positions of ones in A335324.
%K A252895 nonn
%O A252895 1,2
%A A252895 _Walker Dewey Anderson_, Mar 22 2015